Skip to content

Commit

Permalink
[eclipse-ee4j#620]Stream.toList() only available from Java 16 on, rep…
Browse files Browse the repository at this point in the history
…laced it in CollectionsTest, use collect(Collectors.toList()).

Signed-off-by: Anton Pinsky <[email protected]>
  • Loading branch information
api-from-the-ion committed Nov 1, 2023
1 parent 0a24b25 commit 0584477
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 0584477

Please sign in to comment.