code: private JsonObject createMessage(Object value) {
      // Tag the message with a monotonically increasing ID. The ID
      // will be used by the other side of the connection to guarantee
      // ordering.
      JsonObject message = serializer.serialize(value);
      long id = currentMessage++;
      message.putNumber("id", id);
      messages.put(id, message);
      return message;
    }
docs: Creates a value message.