269 |
|
LinkedBlockingDeque q = populatedDeque(3); |
270 |
|
q.pollLast(); |
271 |
|
q.addFirst(four); |
272 |
< |
assertEquals(four,q.peekFirst()); |
272 |
> |
assertSame(four, q.peekFirst()); |
273 |
|
} |
274 |
|
|
275 |
|
/** |
279 |
|
LinkedBlockingDeque q = populatedDeque(3); |
280 |
|
q.pollLast(); |
281 |
|
q.addLast(four); |
282 |
< |
assertEquals(four,q.peekLast()); |
282 |
> |
assertSame(four, q.peekLast()); |
283 |
|
} |
284 |
|
|
285 |
|
|
437 |
|
LinkedBlockingDeque q = populatedDeque(3); |
438 |
|
q.pollLast(); |
439 |
|
q.push(four); |
440 |
< |
assertEquals(four,q.peekFirst()); |
440 |
> |
assertSame(four, q.peekFirst()); |
441 |
|
} |
442 |
|
|
443 |
|
|
1385 |
|
it.remove(); |
1386 |
|
|
1387 |
|
it = q.iterator(); |
1388 |
< |
assertEquals(it.next(), one); |
1389 |
< |
assertEquals(it.next(), three); |
1388 |
> |
assertSame(it.next(), one); |
1389 |
> |
assertSame(it.next(), three); |
1390 |
|
assertFalse(it.hasNext()); |
1391 |
|
} |
1392 |
|
|
1508 |
|
ExecutorService executor = Executors.newFixedThreadPool(2); |
1509 |
|
executor.execute(new CheckedRunnable() { |
1510 |
|
public void realRun() throws InterruptedException { |
1511 |
< |
threadAssertFalse(q.offer(three)); |
1512 |
< |
threadAssertTrue(q.offer(three, MEDIUM_DELAY_MS, MILLISECONDS)); |
1513 |
< |
threadAssertEquals(0, q.remainingCapacity()); |
1511 |
> |
assertFalse(q.offer(three)); |
1512 |
> |
assertTrue(q.offer(three, MEDIUM_DELAY_MS, MILLISECONDS)); |
1513 |
> |
assertEquals(0, q.remainingCapacity()); |
1514 |
|
}}); |
1515 |
|
|
1516 |
|
executor.execute(new CheckedRunnable() { |
1517 |
|
public void realRun() throws InterruptedException { |
1518 |
|
Thread.sleep(SMALL_DELAY_MS); |
1519 |
< |
threadAssertEquals(one, q.take()); |
1519 |
> |
assertSame(one, q.take()); |
1520 |
|
}}); |
1521 |
|
|
1522 |
|
joinPool(executor); |
1530 |
|
ExecutorService executor = Executors.newFixedThreadPool(2); |
1531 |
|
executor.execute(new CheckedRunnable() { |
1532 |
|
public void realRun() throws InterruptedException { |
1533 |
< |
threadAssertNull(q.poll()); |
1534 |
< |
threadAssertTrue(null != q.poll(MEDIUM_DELAY_MS, MILLISECONDS)); |
1535 |
< |
threadAssertTrue(q.isEmpty()); |
1533 |
> |
assertNull(q.poll()); |
1534 |
> |
assertSame(one, q.poll(MEDIUM_DELAY_MS, MILLISECONDS)); |
1535 |
> |
assertTrue(q.isEmpty()); |
1536 |
|
}}); |
1537 |
|
|
1538 |
|
executor.execute(new CheckedRunnable() { |