public static JsonGenerator enableDisableJSONGeneratorFeature(JsonGenerator generator) {
    generator.disable(Feature.AUTO_CLOSE_TARGET);
    generator.setPrettyPrinter(new DefaultPrettyPrinter());
    return generator;
  }
The JSONUtils class is a utility class for getting JSON equivalent from Java types.

@since GemFire 8.0
geode-web-api/src/main/java/org/apache/geode/rest/internal/web/util/JSONUtils.java