89 |
|
*/ |
90 |
|
public void testConstructor5() { |
91 |
|
Integer[] ints = new Integer[SIZE]; |
92 |
< |
for (int i = 0; i < SIZE-1; ++i) |
92 |
> |
for (int i = 0; i < SIZE - 1; ++i) |
93 |
|
ints[i] = new Integer(i); |
94 |
|
try { |
95 |
|
new PriorityQueue(Arrays.asList(ints)); |
120 |
|
for (int i = 0; i < SIZE; ++i) |
121 |
|
ints[i] = new Integer(i); |
122 |
|
q.addAll(Arrays.asList(ints)); |
123 |
< |
for (int i = SIZE-1; i >= 0; --i) |
123 |
> |
for (int i = SIZE - 1; i >= 0; --i) |
124 |
|
assertEquals(ints[i], q.poll()); |
125 |
|
} |
126 |
|
|
144 |
|
public void testSize() { |
145 |
|
PriorityQueue q = populatedQueue(SIZE); |
146 |
|
for (int i = 0; i < SIZE; ++i) { |
147 |
< |
assertEquals(SIZE-i, q.size()); |
147 |
> |
assertEquals(SIZE - i, q.size()); |
148 |
|
q.remove(); |
149 |
|
} |
150 |
|
for (int i = 0; i < SIZE; ++i) { |
236 |
|
public void testAddAll3() { |
237 |
|
PriorityQueue q = new PriorityQueue(SIZE); |
238 |
|
Integer[] ints = new Integer[SIZE]; |
239 |
< |
for (int i = 0; i < SIZE-1; ++i) |
239 |
> |
for (int i = 0; i < SIZE - 1; ++i) |
240 |
|
ints[i] = new Integer(i); |
241 |
|
try { |
242 |
|
q.addAll(Arrays.asList(ints)); |
251 |
|
Integer[] empty = new Integer[0]; |
252 |
|
Integer[] ints = new Integer[SIZE]; |
253 |
|
for (int i = 0; i < SIZE; ++i) |
254 |
< |
ints[i] = new Integer(SIZE-1-i); |
254 |
> |
ints[i] = new Integer(SIZE - 1 - i); |
255 |
|
PriorityQueue q = new PriorityQueue(SIZE); |
256 |
|
assertFalse(q.addAll(Arrays.asList(empty))); |
257 |
|
assertTrue(q.addAll(Arrays.asList(ints))); |
388 |
|
assertTrue(changed); |
389 |
|
|
390 |
|
assertTrue(q.containsAll(p)); |
391 |
< |
assertEquals(SIZE-i, q.size()); |
391 |
> |
assertEquals(SIZE - i, q.size()); |
392 |
|
p.remove(); |
393 |
|
} |
394 |
|
} |
401 |
|
PriorityQueue q = populatedQueue(SIZE); |
402 |
|
PriorityQueue p = populatedQueue(i); |
403 |
|
assertTrue(q.removeAll(p)); |
404 |
< |
assertEquals(SIZE-i, q.size()); |
404 |
> |
assertEquals(SIZE - i, q.size()); |
405 |
|
for (int j = 0; j < i; ++j) { |
406 |
|
Integer x = (Integer)(p.remove()); |
407 |
|
assertFalse(q.contains(x)); |