code: static byte[] generateAgentJson(String agent, long coreId, long channelId) throws Exception {
          String id = paddedHex(coreId) + "/" + paddedHex(channelId);
          if (agent.length() > 200) {
              agent = agent.substring(0, 200);
          }
  
          HashMap<String, String> result = new HashMap<String, String>();
          result.put("a", agent);
          result.put("i", id);
          return DefaultObjectMapper.writeValueAsBytes(result);
      }
docs: Helper method to generate the user agent JSON.