--- jsr166/src/test/tck/Collection8Test.java 2016/11/14 23:52:22 1.24 +++ jsr166/src/test/tck/Collection8Test.java 2016/11/15 00:08:25 1.25 @@ -400,7 +400,7 @@ public class Collection8Test extends JSR public void testRemoveAfterForEachRemaining() { Collection c = impl.emptyCollection(); ThreadLocalRandom rnd = ThreadLocalRandom.current(); - { + testCollection: { int n = 3 + rnd.nextInt(2); for (int i = 0; i < n; i++) c.add(impl.makeElement(i)); Iterator it = c.iterator(); @@ -413,7 +413,10 @@ public class Collection8Test extends JSR if (c instanceof java.util.concurrent.ArrayBlockingQueue) { assertIteratorExhausted(it); } else { - it.remove(); + try { it.remove(); } + catch (UnsupportedOperationException ok) { + break testCollection; + } assertEquals(n - 1, c.size()); for (int i = 0; i < n - 1; i++) assertTrue(c.contains(impl.makeElement(i)));