--- jsr166/src/test/tck/CopyOnWriteArrayListTest.java 2014/12/31 19:05:42 1.31 +++ jsr166/src/test/tck/CopyOnWriteArrayListTest.java 2015/01/17 22:55:06 1.32 @@ -264,11 +264,15 @@ public class CopyOnWriteArrayListTest ex assertTrue(it.hasNext()); assertEquals(elements[j], it.next()); } - assertFalse(it.hasNext()); - try { - it.next(); - shouldThrow(); - } catch (NoSuchElementException success) {} + assertIteratorExhausted(it); + } + + /** + * iterator of empty collection has no elements + */ + public void testEmptyIterator() { + Collection c = new CopyOnWriteArrayList(); + assertIteratorExhausted(c.iterator()); } /**