for (int i = 0; i < 100; i++) {
assertTrue(q1.offer("item" + i, 100, TimeUnit.SECONDS));
assertTrue(q2.offer("item" + i, 100, TimeUnit.SECONDS));
}
assertEquals("item0", q1.peek());
assertEquals("item0", q2.peek());
for (int i = 0; i < 100; i++) {
assertEquals("item" + i, q1.poll());
assertEquals("item" + i, q2.poll());
}
}