class JsonCollectors {

    public static Collector<JsonField, JsonArrayBuilder, JsonArray> fieldKeysToArray() {
        return Collector.of(JsonFactory::newArrayBuilder, (arrayBuilder, field) -> arrayBuilder.add(field.getKeyName()),
                JsonArrayBuilder::addAll, JsonArrayBuilder::build);
    }

    private  JsonCollectors();

}