class EventBus implements Subscriber, Publisher {

  @Override
  public synchronized <T> void unsubscribe(Class<T> type, EventHandler<? super T> handler) {
    Preconditions.checkNotNull(type);
    Preconditions.checkNotNull(handler);

    if (!handlerMap.containsKey(type)) {
      return;
    }

    ConcurrentHashMap<EventHandler<Object>, Executor> handlers = handlerMap.get(type);

    @SuppressWarnings("unchecked")
    EventHandler<Object> casted = (EventHandler<Object>) handler;
    handlers.remove(casted);

    if (handlers.isEmpty()) {
      handlerMap.remove(type);
    }
  }

    EventBus(Executor defaultExecutor);

}