code: public AutoCloseable registerHandler(
        final Class<? extends T> messageType,
        final EventHandler<RemoteMessage<? extends T>> theHandler) {
  
      this.msgTypeToHandlerMap.put(messageType, theHandler);
  
      LOG.log(Level.FINER, "Add handler for class: {0}", messageType.getCanonicalName());
  
      return new SubscriptionHandler<>(messageType, this.unsubscribeClass);
    }
docs: Subscribe for events of a given message type.
  @param messageType Java class of messages to dispatch.
  @param theHandler Message handler.
  @return A new subscription object that will cancel its subscription on .close()