code: public <T extends ObjectAttachableListener> void removeObjectListener(
              Class<?> objectClass, long objectId, Class<T> listenerClass, T listener) {
          synchronized (objectListeners) {
              if (objectClass == null) {
                  return;
              }
              Map<Long, Map<Class<? extends ObjectAttachableListener>, Map<ObjectAttachableListener,
                      ListenerManagerImpl<? extends ObjectAttachableListener>>>> objectListener =
                      objectListeners.get(objectClass);
              if (objectListener == null) {
                  return;
              }
              Map<Class<? extends ObjectAttachableListener>, Map<ObjectAttachableListener,
                      ListenerManagerImpl<? extends ObjectAttachableListener>>> listeners = objectListener.get(objectId);
              if (listeners == null) {
                  return;
              }
              Map<ObjectAttachableListener, ListenerManagerImpl<? extends ObjectAttachableListener>> classListeners =
                      listeners.get(listenerClass);
              if (classListeners == null) {
                  return;
              }
              ListenerManagerImpl<? extends ObjectAttachableListener> listenerManager = classListeners.get(listener);
              if (listenerManager == null) {
                  return;
              }
              classListeners.remove(listener);
              listenerManager.removed();
              // Clean it up
              if (classListeners.isEmpty()) {
                  listeners.remove(listenerClass);
                  if (listeners.isEmpty()) {
                      objectListener.remove(objectId);
                      if (objectListener.isEmpty()) {
                          objectListeners.remove(objectClass);
                      }
                  }
              }
          }
      }
docs: Removes an object listener.
  
  @param objectClass The class of the object.
  @param objectId The id of the object.
  @param listenerClass The listener class.
  @param listener The listener to remove.
  @param <T> The type of the listener.