JsonUtils { public static JsonArray createArray(JsonValue... values) { return Stream.of(values).collect(asArray()); } private  JsonUtils(); static boolean jsonEquals(JsonValue a, JsonValue b); static Stream<T> stream(JsonArray array); static Stream<JsonObject> objectStream(JsonArray array); static DoubleStream numberStream(JsonArray array); static Collector<JsonValue, JsonArray, JsonArray> asArray(); static JsonArray createArray(JsonValue... values); static JsonObject createObject(Map<String, T> map,
            Function<T, JsonValue> itemToJson); static JsonObject beanToJson(Object bean); static JsonArray listToJson(List<?> list); static JsonObject mapToJson(Map<String, ?> map);  }
@Test public void testCreateArray() { JsonArray array = JsonUtils.createArray(Json.create("string"), Json.createNull()); Assert.assertEquals(2, array.length()); Assert.assertEquals("string", array.getString(0)); Assert.assertSame(JreJsonNull.class, array.get(1).getClass()); }
@Test public void testCreateEmptyArray() { JsonArray array = JsonUtils.createArray(); Assert.assertEquals(0, array.length()); }