code: public static String toJSONString(final Object obj) {
          try {
              return mapper.writeValueAsString(obj);
          } catch (final JsonProcessingException e) {
              logger.error("Cannot to JSON string", e);
          }
          return null;
      }
docs: Returns the JSON string for the object.
  
  @param obj the object
  @return the JSON string