code: @SuppressWarnings("unchecked")
      public <T extends ObjectAttachableListener> Map<T, List<Class<T>>> getObjectListeners(
              Class<?> objectClass, long objectId) {
          return Collections.unmodifiableMap(Optional.ofNullable(objectClass)
                  .map(objectListeners::get)
                  .map(objectListener -> objectListener.get(objectId))
                  .map(Map::entrySet)
                  .map(Set::stream)
                  .map(entryStream -> entryStream
                          .flatMap(entry -> entry
                                  .getValue()
                                  .keySet()
                                  .stream()
                                  .map(listener -> new SimpleEntry<>((T) listener, (Class<T>) entry.getKey()))))
                  .map(entryStream -> entryStream
                          .collect(Collectors.groupingBy(Entry::getKey,
                                                         Collectors.mapping(Entry::getValue, Collectors.toList()))))
                  .orElseGet(HashMap::new));
      }
docs: Gets a map with all registered listeners that implement one or more {@code ObjectAttachableListener}s and their
  assigned listener classes they listen to.
  
  @param objectClass The class of the object.
  @param objectId The id of the object.
  @param <T> The type of the listeners.
  @return A map with all registered listeners that implement one or more {@code ObjectAttachableListener}s and
  their assigned listener classes they listen to.