From 15126c4d8884c2aba600de292798b70e8c9f27c7 Mon Sep 17 00:00:00 2001 From: Grzegorz Piwowarek Date: Mon, 9 Oct 2023 20:18:04 +0200 Subject: [PATCH] Replace Collectors#toList with Stream#toList (#788) --- src/test/java/com/pivovarit/collectors/FunctionalTest.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/test/java/com/pivovarit/collectors/FunctionalTest.java b/src/test/java/com/pivovarit/collectors/FunctionalTest.java index 17f27c70..3172a5a2 100644 --- a/src/test/java/com/pivovarit/collectors/FunctionalTest.java +++ b/src/test/java/com/pivovarit/collectors/FunctionalTest.java @@ -322,7 +322,7 @@ private static > DynamicTest shouldMaintainOrder(C private static > DynamicTest shouldShortCircuitOnException(CollectorSupplier, Executor, Integer, Collector>> collector, String name) { return dynamicTest(format("%s: should short circuit on exception", name), () -> { - List elements = IntStream.range(0, 100).boxed().collect(toList()); + List elements = IntStream.range(0, 100).boxed().toList(); int size = 4; runWithExecutor(e -> { @@ -340,7 +340,7 @@ private static > DynamicTest shouldShortCircuitOnE private static > DynamicTest shouldHandleThrowable(CollectorSupplier, Executor, Integer, Collector>> collector, String name) { return dynamicTest(format("%s: should not swallow exception", name), () -> { - List elements = IntStream.range(0, 10).boxed().collect(toList()); + List elements = IntStream.range(0, 10).boxed().toList(); runWithExecutor(e -> { assertThatThrownBy(elements.stream() @@ -360,7 +360,7 @@ private static > DynamicTest shouldHandleThrowable private static > DynamicTest shouldHandleRejectedExecutionException(CollectorSupplier, Executor, Integer, Collector>> collector, String name) { return dynamicTest(format("%s: should propagate rejected execution exception", name), () -> { Executor executor = command -> { throw new RejectedExecutionException(); }; - List elements = IntStream.range(0, 1000).boxed().collect(toList()); + List elements = IntStream.range(0, 1000).boxed().toList(); assertThatThrownBy(() -> elements.stream() .collect(collector.apply(i -> returnWithDelay(i, ofMillis(10000)), executor, PARALLELISM))