From 05844778355f949ed09d288f0347a67d19a8ba64 Mon Sep 17 00:00:00 2001 From: Anton Pinsky Date: Wed, 1 Nov 2023 15:24:56 +0100 Subject: [PATCH] [#620]Stream.toList() only available from Java 16 on, replaced it in CollectionsTest, use collect(Collectors.toList()). Signed-off-by: Anton Pinsky --- .../yasson/defaultmapping/collections/CollectionsTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/java/org/eclipse/yasson/defaultmapping/collections/CollectionsTest.java b/src/test/java/org/eclipse/yasson/defaultmapping/collections/CollectionsTest.java index fb31ec15..b7b90c0f 100644 --- a/src/test/java/org/eclipse/yasson/defaultmapping/collections/CollectionsTest.java +++ b/src/test/java/org/eclipse/yasson/defaultmapping/collections/CollectionsTest.java @@ -114,9 +114,9 @@ public void listOfMapsOfListsOfMaps() { IntStream.range(0, 3).boxed().collect(Collectors.toMap(String::valueOf, j -> IntStream.range(0, 3).mapToObj(k -> new HashMap<>(Map.of("first", 1, "second", 2, "third", 3)) - ).toList() + ).collect(Collectors.toList()) )) - ).toList(); + ).collect(Collectors.toList()); String expected = "[{\"0\":[{\"third\":3,\"first\":1,\"second\":2},{\"third\":3,\"first\":1,\"second\":2},{\"third\":3,\"first\":1,\"second\":2}],\"1\":[{\"third\":3,\"first\":1,\"second\":2},{\"third\":3,\"first\":1,\"second\":2},{\"third\":3,\"first\":1,\"second\":2}],\"2\":[{\"third\":3,\"first\":1,\"second\":2},{\"third\":3,\"first\":1,\"second\":2},{\"third\":3,\"first\":1,\"second\":2}]},{\"0\":[{\"third\":3,\"first\":1,\"second\":2},{\"third\":3,\"first\":1,\"second\":2},{\"third\":3,\"first\":1,\"second\":2}],\"1\":[{\"third\":3,\"first\":1,\"second\":2},{\"third\":3,\"first\":1,\"second\":2},{\"third\":3,\"first\":1,\"second\":2}],\"2\":[{\"third\":3,\"first\":1,\"second\":2},{\"third\":3,\"first\":1,\"second\":2},{\"third\":3,\"first\":1,\"second\":2}]},{\"0\":[{\"third\":3,\"first\":1,\"second\":2},{\"third\":3,\"first\":1,\"second\":2},{\"third\":3,\"first\":1,\"second\":2}],\"1\":[{\"third\":3,\"first\":1,\"second\":2},{\"third\":3,\"first\":1,\"second\":2},{\"third\":3,\"first\":1,\"second\":2}],\"2\":[{\"third\":3,\"first\":1,\"second\":2},{\"third\":3,\"first\":1,\"second\":2},{\"third\":3,\"first\":1,\"second\":2}]}]"; assertEquals(expected, nullableJsonb.toJson(listOfMapsOfListsOfMaps));