--- jsr166/src/test/tck/CopyOnWriteArraySetTest.java 2014/12/31 19:05:42 1.28 +++ jsr166/src/test/tck/CopyOnWriteArraySetTest.java 2015/01/17 22:55:06 1.29 @@ -194,11 +194,14 @@ public class CopyOnWriteArraySetTest ext 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() { + assertIteratorExhausted(new CopyOnWriteArraySet().iterator()); } /**