code: public IoFuture removeListener(IoFutureListener<?> listener) {
          if (listener == null) {
              throw new NullPointerException("listener");
          }
  
          synchronized (lock) {
              if (!ready) {
                  if (listener == firstListener) {
                      if (otherListeners != null && !otherListeners.isEmpty()) {
                          firstListener = otherListeners.remove(0);
                      } else {
                          firstListener = null;
                      }
                  } else if (otherListeners != null) {
                      otherListeners.remove(listener);
                  }
              }
          }
  
          return this;
      }
docs: {@inheritDoc}