class EventBus implements Subscriber, Publisher {

  @Override
  public synchronized <T> void subscribe(
      Class<T> type, Executor executor, EventHandler<? super T> handler) {
    Preconditions.checkNotNull(type);
    Preconditions.checkNotNull(handler);
    Preconditions.checkNotNull(executor);
    if (!handlerMap.containsKey(type)) {
      handlerMap.put(type, new ConcurrentHashMap<>());
    }

    @SuppressWarnings("unchecked")
    EventHandler<Object> casted = (EventHandler<Object>) handler;
    handlerMap.get(type).put(casted, executor);
  }

    EventBus(Executor defaultExecutor);

}