699 |
|
ExecutorService executor = Executors.newFixedThreadPool(2); |
700 |
|
executor.execute(new CheckedRunnable() { |
701 |
|
public void realRun() throws InterruptedException { |
702 |
< |
threadAssertNull(q.poll()); |
703 |
< |
threadAssertTrue(null != q.poll(MEDIUM_DELAY_MS, MILLISECONDS)); |
704 |
< |
threadAssertTrue(q.isEmpty()); |
702 |
> |
assertNull(q.poll()); |
703 |
> |
assertSame(one, q.poll(MEDIUM_DELAY_MS, MILLISECONDS)); |
704 |
> |
assertTrue(q.isEmpty()); |
705 |
|
}}); |
706 |
|
|
707 |
|
executor.execute(new CheckedRunnable() { |
708 |
|
public void realRun() throws InterruptedException { |
709 |
|
Thread.sleep(SMALL_DELAY_MS); |
710 |
< |
q.put(new Integer(1)); |
710 |
> |
q.put(one); |
711 |
|
}}); |
712 |
|
|
713 |
|
joinPool(executor); |