code: public ChatMessage sendMessage(String text) {
          if (text != null && !text.isEmpty()) {
              ChatMessage message = new ChatMessage(self, text);
              eventManager.fireRemoteEvent(sendEvent, message);
              return message;
          }
          
          return null;
      }
docs: Sends a message to a chat session.
  
  @param text The message text.
  @return The message that was sent (may be null if no text).