JsonUtils { public static Stream<JsonObject> objectStream(JsonArray array) { return stream(array); } 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 testObjectStream() { JsonArray array = Stream.of(Json.createObject(), createTestObject1(), createTestObject2()).collect(JsonUtils.asArray()); List<JsonObject> objects = JsonUtils.objectStream(array) .collect(Collectors.toList()); Assert.assertEquals(3, objects.size()); Assert.assertTrue( JsonUtils.jsonEquals(Json.createObject(), objects.get(0))); Assert.assertTrue( JsonUtils.jsonEquals(createTestObject1(), objects.get(1))); Assert.assertTrue( JsonUtils.jsonEquals(createTestObject2(), objects.get(2))); }