427 |
|
*/ |
428 |
|
public void testIterator() { |
429 |
|
ConcurrentLinkedQueue q = populatedQueue(SIZE); |
430 |
– |
int i = 0; |
430 |
|
Iterator it = q.iterator(); |
431 |
< |
while (it.hasNext()) { |
431 |
> |
int i; |
432 |
> |
for (i = 0; it.hasNext(); i++) |
433 |
|
assertTrue(q.contains(it.next())); |
434 |
– |
++i; |
435 |
– |
} |
434 |
|
assertEquals(i, SIZE); |
435 |
+ |
assertIteratorExhausted(it); |
436 |
+ |
} |
437 |
+ |
|
438 |
+ |
/** |
439 |
+ |
* iterator of empty collection has no elements |
440 |
+ |
*/ |
441 |
+ |
public void testEmptyIterator() { |
442 |
+ |
assertIteratorExhausted(new ConcurrentLinkedQueue().iterator()); |
443 |
|
} |
444 |
|
|
445 |
|
/** |