9 |
|
import junit.framework.*; |
10 |
|
import java.util.Arrays; |
11 |
|
import java.util.ArrayList; |
12 |
+ |
import java.util.Collection; |
13 |
|
import java.util.Iterator; |
14 |
|
import java.util.NoSuchElementException; |
15 |
|
import java.util.concurrent.BlockingQueue; |
652 |
|
public void realRun() throws InterruptedException { |
653 |
|
assertNull(q.poll()); |
654 |
|
threadsStarted.await(); |
655 |
< |
assertTrue(null != q.poll(LONG_DELAY_MS, MILLISECONDS)); |
655 |
> |
assertNotNull(q.poll(LONG_DELAY_MS, MILLISECONDS)); |
656 |
|
checkEmpty(q); |
657 |
|
}}); |
658 |
|
|
772 |
|
} |
773 |
|
} |
774 |
|
|
775 |
+ |
/** |
776 |
+ |
* remove(null), contains(null) always return false |
777 |
+ |
*/ |
778 |
+ |
public void testNeverContainsNull() { |
779 |
+ |
Collection<?> q = populatedQueue(SIZE); |
780 |
+ |
assertFalse(q.contains(null)); |
781 |
+ |
assertFalse(q.remove(null)); |
782 |
+ |
} |
783 |
|
} |