482 |
|
} |
483 |
|
|
484 |
|
/** |
485 |
– |
* remove(x) removes x and returns true if present |
486 |
– |
*/ |
487 |
– |
public void testRemoveElement() { |
488 |
– |
DelayQueue q = populatedQueue(SIZE); |
489 |
– |
for (int i = 1; i < SIZE; i+=2) { |
490 |
– |
assertTrue(q.remove(new PDelay(i))); |
491 |
– |
} |
492 |
– |
for (int i = 0; i < SIZE; i+=2) { |
493 |
– |
assertTrue(q.remove(new PDelay(i))); |
494 |
– |
assertFalse(q.remove(new PDelay(i+1))); |
495 |
– |
} |
496 |
– |
assertTrue(q.isEmpty()); |
497 |
– |
} |
498 |
– |
|
499 |
– |
/** |
485 |
|
* contains(x) reports true when elements added but not yet removed |
486 |
|
*/ |
487 |
|
public void testContains() { |