public <T extends SafeCloseable>T add(T closeable){
  boolean needToClose=false;
synchronized (mLock) {
    if (mClosed) {
      needToClose=true;
    }
 else {
      mCloseables.add(closeable);
    }
  }
  if (needToClose) {
    closeable.close();
  }
  return closeable;
}

public < T extends SafeCloseable > T add ( T closeable ) { boolean needToClose = false ; synchronized ( mLock ) { if ( mClosed ) { needToClose = true ; } else { mCloseables . add ( closeable ) ; } } if ( needToClose ) { closeable . close ( ) ; } return closeable ; }
adds the given object to this lifetime and returns it .
