public static <T> Collector<T, JsonObjectBuilder, JsonObject> collectToObject(Function<? super T, String> keyMapper, Function<? super T, JsonElement> valueMapper) {
        return Collector.of(
                JsonBuilder::object,
                (r, t) -> r.add(keyMapper.apply(t), valueMapper.apply(t)),
                (l, r) -> l.addAll(r.build()),
                JsonObjectBuilder::build
        );
    }
Returns a collector which forms a JsonObject using the key and value mappers

@param keyMapper the function to map from T to {@link String}
@param valueMapper the function to map from T to {@link JsonElement}
@param <T> the type
@return a new collector
helper/src/main/java/me/lucko/helper/gson/JsonBuilder.java