code: private void routeMessage(Message message) {
          Class messageClass = message.getClass();
  
          // Dispatch message to all specific listeners for the message class type
          if (messageListenerMap.containsKey(messageClass)) {
              dispatchMessage(messageListenerMap.get(messageClass), message);
          }
  
          // Dispatch message to all generic listeners
          if (messageListenerMap.containsKey(Message.class)) {
              dispatchMessage(messageListenerMap.get(Message.class), message);
          }
      }
docs: Route a Message object built from data over the SerialPort communication line to a corresponding
  MessageListener array designed to handle and interpret the object for processing in the client code.
  
  @param message Firmata Message to be routed to the registered listeners.