--- jsr166/src/test/tck/Collection8Test.java 2016/11/18 17:23:29 1.28 +++ jsr166/src/test/tck/Collection8Test.java 2016/11/22 01:08:14 1.29 @@ -545,6 +545,8 @@ public class Collection8Test extends JSR final AtomicBoolean done = new AtomicBoolean(false); final Object one = impl.makeElement(1); final Object two = impl.makeElement(2); + final Object[] emptyArray = + (Object[]) java.lang.reflect.Array.newInstance(one.getClass(), 0); final List> futures; final Phaser threadsStarted = new Phaser(1); // register this thread final Runnable[] frobbers = { @@ -564,6 +566,12 @@ public class Collection8Test extends JSR for (Object x : c) assertTrue(x == one || x == two); }, () -> { + for (Object x : c.toArray()) assertTrue(x == one || x == two); + }, + () -> { + for (Object x : c.toArray(emptyArray)) assertTrue(x == one || x == two); + }, + () -> { assertTrue(c.add(one)); assertTrue(c.contains(one)); assertTrue(c.remove(one));