public static Collector<JsonElement, JsonArrayBuilder, JsonArray> collectToArray() {
        return Collector.of(
                JsonBuilder::array,
                JsonArrayBuilder::add,
                (l, r) -> l.addAll(r.build()),
                JsonArrayBuilder::build
        );
    }
Returns a collector which forms a JsonArray from JsonElements

@return a new collector
helper/src/main/java/me/lucko/helper/gson/JsonBuilder.java