code: public void subscribe(final Class<? extends T> clazz, final EventHandler<? extends T> handler) {
      lock.writeLock().lock();
      try {
        List<EventHandler<? extends T>> list = clazzToListOfHandlersMap.get(clazz);
        if (list == null) {
          list = new LinkedList<EventHandler<? extends T>>();
          clazzToListOfHandlersMap.put(clazz, list);
        }
        list.add(handler);
      } finally {
        lock.writeLock().unlock();
      }
    }
docs: Subscribes an event handler for an event class type.
  
  @param clazz   an event class
  @param handler an event handler