# | Line 264 | Line 264 | public class CopyOnWriteArrayListTest ex | |
---|---|---|
264 | assertTrue(it.hasNext()); | |
265 | assertEquals(elements[j], it.next()); | |
266 | } | |
267 | < | assertFalse(it.hasNext()); |
268 | < | try { |
269 | < | it.next(); |
270 | < | shouldThrow(); |
271 | < | } catch (NoSuchElementException success) {} |
267 | > | assertIteratorExhausted(it); |
268 | > | } |
269 | > | |
270 | > | /** |
271 | > | * iterator of empty collection has no elements |
272 | > | */ |
273 | > | public void testEmptyIterator() { |
274 | > | Collection c = new CopyOnWriteArrayList(); |
275 | > | assertIteratorExhausted(c.iterator()); |
276 | } | |
277 | ||
278 | /** |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |