55 |
|
} |
56 |
|
|
57 |
|
/** |
58 |
< |
* Create 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) { |
708 |
|
ArrayList l = new ArrayList(); |
709 |
|
q.drainTo(l, i); |
710 |
|
int k = (i < SIZE) ? i : SIZE; |
711 |
< |
assertEquals(l.size(), k); |
712 |
< |
assertEquals(q.size(), SIZE-k); |
711 |
> |
assertEquals(k, l.size()); |
712 |
> |
assertEquals(SIZE-k, q.size()); |
713 |
|
for (int j = 0; j < k; ++j) |
714 |
|
assertEquals(l.get(j), new Integer(j)); |
715 |
|
while (q.poll() != null) ; |