696 |
|
*/ |
697 |
|
public void testIterator() { |
698 |
|
ConcurrentLinkedDeque q = populatedDeque(SIZE); |
699 |
– |
int i = 0; |
699 |
|
Iterator it = q.iterator(); |
700 |
< |
while (it.hasNext()) { |
700 |
> |
int i; |
701 |
> |
for (i = 0; it.hasNext(); i++) |
702 |
|
assertTrue(q.contains(it.next())); |
703 |
– |
++i; |
704 |
– |
} |
703 |
|
assertEquals(i, SIZE); |
704 |
+ |
assertIteratorExhausted(it); |
705 |
+ |
} |
706 |
+ |
|
707 |
+ |
/** |
708 |
+ |
* iterator of empty collection has no elements |
709 |
+ |
*/ |
710 |
+ |
public void testEmptyIterator() { |
711 |
+ |
Deque c = new ConcurrentLinkedDeque(); |
712 |
+ |
assertIteratorExhausted(c.iterator()); |
713 |
+ |
assertIteratorExhausted(c.descendingIterator()); |
714 |
|
} |
715 |
|
|
716 |
|
/** |