code: public static JsonNode toJson(final Object data) {
          if (data == null) {
              return newObject();
          }
  
          try {
              return createObjectMapper().valueToTree(data);
          } catch (Exception e) {
              throw new ParseException(e);
          }
      }
docs: Convert an object to JsonNode.
  
  @param data Value to convert in Json.
  @return creates a new json object from given data object
  @throws ParseException to runtime if object can't be parsed