code: public synchronized void registerHandler(Object handler) {
          boolean validClass = false;
          
          if (handler==null) {
              throw new IllegalArgumentException("Null handler class");
          }
          
          // Get the implemented interfaces. This gets only the
          // directly implemented interfaces
          Class<?> clazz = handler.getClass();
          Class<?> interfaces[] = clazz.getInterfaces();
          
          for (int i=0; i<interfaces.length; i++) {
              String iName = interfaces[i].getSimpleName();
              
              // verify the interface is for an event interface
              if (iName.contains(EVENT_INTERFACE_SUFFIX)) {
                  validClass = true;
                  String eventCategory = iName.substring(0, iName.indexOf(EVENT_INTERFACE_SUFFIX)).toLowerCase();
                  
                  // see if a handler has been registered for the interface type
                  if (eventHandlers.get(eventCategory)==null) {
                      eventHandlers.put(eventCategory, handler);
                  } else {
                      throw new ApiException("Handler already registered for event type " + iName);
                  }
              }
          }
          
          if (!validClass) {
              throw new ApiException("Class is invalid, it does not implement any event interfaces: " + clazz.getName());
          }
      }
docs: Register an event handler. The registration looks at the interfaces
  that the handler implements. An entry is created in the event handler
  map for each event interface that is implemented.
  
  Event interfaces are named in the form [Category]Event (e.g. ProductEvent)
  
  @param handler handler class