public static String encodeAsString(Object obj) throws JsonProcessingException {
        return MAPPER.writeValueAsString(obj);
    }
Encode an object into a JSON string. This method accepts any type supported by Jackson's ObjectMapper in
the default configuration. That is, Java collections are supported, but Scala collections are not (to avoid
a jackson-scala dependency).
server-common/src/main/java/org/apache/kafka/server/util/Json.java