2525
2626import static conseq4j .TestUtils .createSpyingTasks ;
2727import static conseq4j .TestUtils .getAllCompleteNormal ;
28- import static java .util .stream .Collectors .toList ;
2928import static org .junit .jupiter .api .Assertions .*;
3029
3130import com .google .common .collect .Range ;
3736import java .util .concurrent .ExecutionException ;
3837import java .util .concurrent .ExecutorService ;
3938import java .util .concurrent .Future ;
40- import java .util .stream .Collectors ;
4139import lombok .NonNull ;
4240import org .junit .jupiter .api .Nested ;
4341import org .junit .jupiter .api .Test ;
@@ -47,7 +45,7 @@ class ConseqServiceFactoryTest {
4745 private static final int TASK_COUNT = 100 ;
4846
4947 private static List <Callable <SpyingTask >> toCallables (@ NonNull List <SpyingTask > tasks ) {
50- return tasks .stream ().map (SpyingTask ::toCallable ).collect ( Collectors . toList () );
48+ return tasks .stream ().map (SpyingTask ::toCallable ).toList ();
5149 }
5250
5351 void assertSingleThread (@ NonNull List <SpyingTask > tasks ) {
@@ -66,7 +64,7 @@ void concurrencyBoundedByTotalTaskCount() {
6664 .map (task -> withHigherConcurrencyThanTaskCount
6765 .getExecutorService (UUID .randomUUID ())
6866 .submit (task .toCallable ()))
69- .collect ( toList () );
67+ .toList ();
7068 }
7169
7270 final long totalRunThreads = getAllCompleteNormal (futures ).stream ()
@@ -88,7 +86,7 @@ void higherConcurrencyRendersBetterThroughput() {
8886 lowConcurrencyStart = System .nanoTime ();
8987 lowConcurrencyFutures = sameTasks .stream ()
9088 .map (t -> withLowConcurrency .getExecutorService (UUID .randomUUID ()).submit (t .toCallable ()))
91- .collect ( toList () );
89+ .toList ();
9290 }
9391 TestUtils .awaitFutures (lowConcurrencyFutures );
9492 long lowConcurrencyTime = System .nanoTime () - lowConcurrencyStart ;
@@ -101,7 +99,7 @@ void higherConcurrencyRendersBetterThroughput() {
10199 highConcurrencyFutures = sameTasks .stream ()
102100 .map (task ->
103101 withHighConcurrency .getExecutorService (UUID .randomUUID ()).submit (task .toCallable ()))
104- .collect ( toList () );
102+ .toList ();
105103 }
106104 TestUtils .awaitFutures (highConcurrencyFutures );
107105 long highConcurrencyTime = System .nanoTime () - highConcurrencyStart ;
0 commit comments