174 |
|
} |
175 |
|
|
176 |
|
/** |
177 |
< |
* poll succeeds unless empty |
177 |
> |
* poll succeeds unless empty |
178 |
|
*/ |
179 |
|
public void testPoll() { |
180 |
|
LinkedList q = populatedQueue(SIZE); |
185 |
|
} |
186 |
|
|
187 |
|
/** |
188 |
< |
* peek returns next element, or null if empty |
188 |
> |
* peek returns next element, or null if empty |
189 |
|
*/ |
190 |
|
public void testPeek() { |
191 |
|
LinkedList q = populatedQueue(SIZE); |
214 |
|
} |
215 |
|
|
216 |
|
/** |
217 |
< |
* remove removes next element, or throws NSEE if empty |
217 |
> |
* remove removes next element, or throws NSEE if empty |
218 |
|
*/ |
219 |
|
public void testRemove() { |
220 |
|
LinkedList q = populatedQueue(SIZE); |
318 |
|
} |
319 |
|
|
320 |
|
/** |
321 |
< |
* toArray contains all elements |
321 |
> |
* toArray contains all elements |
322 |
|
*/ |
323 |
|
public void testToArray() { |
324 |
|
LinkedList q = populatedQueue(SIZE); |
329 |
|
} |
330 |
|
|
331 |
|
/** |
332 |
< |
* toArray(a) contains all elements |
332 |
> |
* toArray(a) contains all elements |
333 |
|
*/ |
334 |
|
public void testToArray2() { |
335 |
|
LinkedList q = populatedQueue(SIZE); |
341 |
|
} |
342 |
|
|
343 |
|
/** |
344 |
< |
* toArray(null) throws NPE |
344 |
> |
* toArray(null) throws NullPointerException |
345 |
|
*/ |
346 |
< |
public void testToArray_BadArg() { |
346 |
> |
public void testToArray_NullArg() { |
347 |
|
LinkedList l = new LinkedList(); |
348 |
|
l.add(new Object()); |
349 |
|
try { |
350 |
< |
Object o[] = l.toArray(null); |
350 |
> |
l.toArray(null); |
351 |
|
shouldThrow(); |
352 |
|
} catch (NullPointerException success) {} |
353 |
|
} |
354 |
|
|
355 |
|
/** |
356 |
< |
* toArray with incompatible array type throws CCE |
356 |
> |
* toArray(incompatible array type) throws ArrayStoreException |
357 |
|
*/ |
358 |
|
public void testToArray1_BadArg() { |
359 |
|
LinkedList l = new LinkedList(); |
360 |
|
l.add(new Integer(5)); |
361 |
|
try { |
362 |
< |
Object o[] = l.toArray(new String[10]); |
362 |
> |
l.toArray(new String[10]); |
363 |
|
shouldThrow(); |
364 |
|
} catch (ArrayStoreException success) {} |
365 |
|
} |
366 |
|
|
367 |
|
/** |
368 |
< |
* iterator iterates through all elements |
368 |
> |
* iterator iterates through all elements |
369 |
|
*/ |
370 |
|
public void testIterator() { |
371 |
|
LinkedList q = populatedQueue(SIZE); |
379 |
|
} |
380 |
|
|
381 |
|
/** |
382 |
< |
* iterator ordering is FIFO |
382 |
> |
* iterator ordering is FIFO |
383 |
|
*/ |
384 |
|
public void testIteratorOrdering() { |
385 |
|
final LinkedList q = new LinkedList(); |
412 |
|
} |
413 |
|
|
414 |
|
/** |
415 |
< |
* Descending iterator iterates through all elements |
415 |
> |
* Descending iterator iterates through all elements |
416 |
|
*/ |
417 |
|
public void testDescendingIterator() { |
418 |
|
LinkedList q = populatedQueue(SIZE); |
431 |
|
} |
432 |
|
|
433 |
|
/** |
434 |
< |
* Descending iterator ordering is reverse FIFO |
434 |
> |
* Descending iterator ordering is reverse FIFO |
435 |
|
*/ |
436 |
|
public void testDescendingIteratorOrdering() { |
437 |
|
final LinkedList q = new LinkedList(); |
494 |
|
} |
495 |
|
|
496 |
|
/** |
497 |
< |
* pop removes next element, or throws NSEE if empty |
497 |
> |
* pop removes next element, or throws NSEE if empty |
498 |
|
*/ |
499 |
|
public void testPop() { |
500 |
|
LinkedList q = populatedQueue(SIZE); |
526 |
|
} |
527 |
|
|
528 |
|
/** |
529 |
< |
* pollLast succeeds unless empty |
529 |
> |
* pollLast succeeds unless empty |
530 |
|
*/ |
531 |
|
public void testPollLast() { |
532 |
|
LinkedList q = populatedQueue(SIZE); |
537 |
|
} |
538 |
|
|
539 |
|
/** |
540 |
< |
* peekFirst returns next element, or null if empty |
540 |
> |
* peekFirst returns next element, or null if empty |
541 |
|
*/ |
542 |
|
public void testPeekFirst() { |
543 |
|
LinkedList q = populatedQueue(SIZE); |
552 |
|
|
553 |
|
|
554 |
|
/** |
555 |
< |
* peekLast returns next element, or null if empty |
555 |
> |
* peekLast returns next element, or null if empty |
556 |
|
*/ |
557 |
|
public void testPeekLast() { |
558 |
|
LinkedList q = populatedQueue(SIZE); |
578 |
|
} |
579 |
|
|
580 |
|
/** |
581 |
< |
* getLast returns next element, or throws NSEE if empty |
581 |
> |
* getLast returns next element, or throws NSEE if empty |
582 |
|
*/ |
583 |
|
public void testLastElement() { |
584 |
|
LinkedList q = populatedQueue(SIZE); |