547 |
|
final Object two = impl.makeElement(2); |
548 |
|
final List<Future<?>> futures; |
549 |
|
final Phaser threadsStarted = new Phaser(1); // register this thread |
550 |
< |
final List<Runnable> tasks = List.<Runnable>of( |
550 |
> |
final Runnable[] frobbers = { |
551 |
|
() -> c.forEach(x -> assertTrue(x == one || x == two)), |
552 |
|
() -> c.stream().forEach(x -> assertTrue(x == one || x == two)), |
553 |
|
() -> c.spliterator().trySplit(), |
574 |
|
assertTrue(c.contains(two)); |
575 |
|
assertTrue(c.remove(two)); |
576 |
|
assertFalse(c.contains(two)); |
577 |
< |
}) |
578 |
< |
.stream() |
577 |
> |
}, |
578 |
> |
}; |
579 |
> |
final List<Runnable> tasks = |
580 |
> |
Arrays.stream(frobbers) |
581 |
|
.filter(task -> rnd.nextBoolean()) // random subset |
582 |
|
.map(task -> (Runnable) () -> { |
583 |
|
threadsStarted.arriveAndAwaitAdvance(); |