Skip to content

Commit ef6bb34

Browse files
committed
+ clean up
1 parent 8253165 commit ef6bb34

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/test/java/conseq4j/summon/ConseqServiceFactoryTest.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525

2626
import static conseq4j.TestUtils.createSpyingTasks;
2727
import static conseq4j.TestUtils.getAllCompleteNormal;
28-
import static java.util.stream.Collectors.toList;
2928
import static org.junit.jupiter.api.Assertions.*;
3029

3130
import com.google.common.collect.Range;
@@ -37,7 +36,6 @@
3736
import java.util.concurrent.ExecutionException;
3837
import java.util.concurrent.ExecutorService;
3938
import java.util.concurrent.Future;
40-
import java.util.stream.Collectors;
4139
import lombok.NonNull;
4240
import org.junit.jupiter.api.Nested;
4341
import 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

Comments
 (0)