public void removeListener(final T listener) {
    Preconditions.checkNotNull(listener, "Internal Error: Listener cannot be null");

    if (m_listeners != null) {
      // TODO(timkornau): b/15378569
      synchronized (m_listeners) {
        if (!m_listeners.remove(new ComparableReference(listener))) {
          // TODO (timkornau): this always happens if a script has been called and then after that
          // you try to close the view. throw new
          // IllegalStateException("Error: Listener was not listening.");
        }
      }
    }
  }
Removes a listener from the listener provider.

@param listener The listener to remove.
@throws NullPointerException Thrown if the listener object is null.
@throws IllegalStateException Thrown if the listener object was not managed by the listener
    provider.
java/zylib/src/main/java/com/google/security/zynamics/zylib/general/ListenerProvider.java