code: protected Future<T> removeFromListeners(
      GenericCompletionListener<? extends Future<T>> listener) {
      if (listener == null) {
        throw new IllegalArgumentException("The listener can't be null.");
      }
  
      if (!isDone()) {
        synchronized(this) {
          listeners.remove(listener);
        }
      }
      return this;
    }
docs: Remove a listener from the list of registered listeners.
  
  @param listener the listener to remove.
  @return the current future to allow for chaining.