JsonUtils { public static DoubleStream numberStream(JsonArray array) { return JsonUtils.<JsonNumber> stream(array) .mapToDouble(JsonNumber::getNumber); } 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 testNumberStream() { double[] values = new double[] { 3.14, 42, Double.MAX_VALUE }; JsonArray array = DoubleStream.of(values).mapToObj(Json::create) .collect(JsonUtils.asArray()); DoubleStream numberStream = JsonUtils.numberStream(array); Assert.assertArrayEquals(values, numberStream.toArray(), 0); }