Skip to content

Commit

Permalink
[eclipse-ee4j#620]Used a "new" switch from Java 14 in CollectionsTest…
Browse files Browse the repository at this point in the history
…, corrected this.

Signed-off-by: Anton Pinsky <[email protected]>
  • Loading branch information
api-from-the-ion committed Nov 1, 2023
1 parent f660a9f commit 0a24b25
Showing 1 changed file with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import java.util.Deque;
import java.util.EnumMap;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
Expand All @@ -37,7 +38,6 @@
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.ConcurrentNavigableMap;
import java.util.concurrent.ConcurrentSkipListMap;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.IntStream;

Expand Down Expand Up @@ -110,15 +110,10 @@ public void testListOfListsOfStrings() {

@Test
public void listOfMapsOfListsOfMaps() {
List<Map<String, List<Map<String, Integer>>>> listOfMapsOfListsOfMaps = IntStream.range(0, 3).mapToObj(i ->
List<Map<String, List<HashMap<String, Integer>>>> listOfMapsOfListsOfMaps = IntStream.range(0, 3).mapToObj(i ->
IntStream.range(0, 3).boxed().collect(Collectors.toMap(String::valueOf, j ->
IntStream.range(0, 3).mapToObj(k ->
IntStream.range(1, 4).boxed().collect(Collectors.toMap(l -> switch (l) {
case 1 -> "first";
case 2 -> "second";
case 3 -> "third";
default -> throw new IllegalStateException("Unexpected value: " + l);
}, Function.identity()))
new HashMap<>(Map.of("first", 1, "second", 2, "third", 3))
).toList()
))
).toList();
Expand Down

0 comments on commit 0a24b25

Please sign in to comment.