55 |
|
} |
56 |
|
|
57 |
|
/** |
58 |
< |
* Creates a queue of given size containing consecutive |
58 |
> |
* Returns a new queue of given size containing consecutive |
59 |
|
* Integers 0 ... n. |
60 |
|
*/ |
61 |
|
private PriorityBlockingQueue<Integer> populatedQueue(int n) { |
644 |
|
Queue x = populatedQueue(SIZE); |
645 |
|
Queue y = serialClone(x); |
646 |
|
|
647 |
< |
assertTrue(x != y); |
647 |
> |
assertNotSame(x, y); |
648 |
|
assertEquals(x.size(), y.size()); |
649 |
|
while (!x.isEmpty()) { |
650 |
|
assertFalse(y.isEmpty()); |
716 |
|
} |
717 |
|
} |
718 |
|
|
719 |
+ |
/** |
720 |
+ |
* remove(null), contains(null) always return false |
721 |
+ |
*/ |
722 |
+ |
public void testNeverContainsNull() { |
723 |
+ |
Collection<?>[] qs = { |
724 |
+ |
new PriorityBlockingQueue<Object>(), |
725 |
+ |
populatedQueue(2), |
726 |
+ |
}; |
727 |
+ |
|
728 |
+ |
for (Collection<?> q : qs) { |
729 |
+ |
assertFalse(q.contains(null)); |
730 |
+ |
assertFalse(q.remove(null)); |
731 |
+ |
} |
732 |
+ |
} |
733 |
+ |
|
734 |
|
} |