ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/tck/Collection8Test.java
(Generate patch)

Comparing jsr166/src/test/tck/Collection8Test.java (file contents):
Revision 1.26 by jsr166, Tue Nov 15 22:59:09 2016 UTC vs.
Revision 1.27 by jsr166, Tue Nov 15 23:08:30 2016 UTC

# Line 547 | Line 547 | public class Collection8Test extends JSR
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(),
# Line 574 | Line 574 | public class Collection8Test extends JSR
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();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines