--- jsr166/src/test/tck/Collection8Test.java 2016/11/15 22:59:09 1.26 +++ jsr166/src/test/tck/Collection8Test.java 2016/11/15 23:08:30 1.27 @@ -547,7 +547,7 @@ public class Collection8Test extends JSR final Object two = impl.makeElement(2); final List> futures; final Phaser threadsStarted = new Phaser(1); // register this thread - final List tasks = List.of( + final Runnable[] frobbers = { () -> c.forEach(x -> assertTrue(x == one || x == two)), () -> c.stream().forEach(x -> assertTrue(x == one || x == two)), () -> c.spliterator().trySplit(), @@ -574,8 +574,10 @@ public class Collection8Test extends JSR assertTrue(c.contains(two)); assertTrue(c.remove(two)); assertFalse(c.contains(two)); - }) - .stream() + }, + }; + final List tasks = + Arrays.stream(frobbers) .filter(task -> rnd.nextBoolean()) // random subset .map(task -> (Runnable) () -> { threadsStarted.arriveAndAwaitAdvance();