public static void writeCollectionAsJson(JsonGenerator generator, /* List */ Collection<?> coll)
      throws IOException {
    generator.writeStartArray();

    for (Object obj : coll) {
      writeValueAsJson(generator, obj, null);
    }
    generator.writeEndArray();
  }
The JsonWriter class is an utility to write various java types as a JSON string.
<p>

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