521522523524525526527528529530531
*/ @Test public void testPeek() { BlockingQueue q = populatedQueue(SIZE); for (int i = 0; i < SIZE; ++i) { assertEquals(i, q.peek()); assertEquals(i, q.poll()); assertTrue(q.peek() == null || !q.peek().equals(i)); } assertNull(q.peek());
523524525526527528529530531532533
public void testPeek() { BlockingQueue q = populatedQueue(SIZE); for (int i = 0; i < SIZE; ++i) { assertEquals(i, q.peek()); assertEquals(i, q.poll()); assertTrue(q.peek() == null || !q.peek().equals(i)); } assertNull(q.peek()); }
524525526527528529530531532533534
BlockingQueue q = populatedQueue(SIZE); for (int i = 0; i < SIZE; ++i) { assertEquals(i, q.peek()); assertEquals(i, q.poll()); assertTrue(q.peek() == null || !q.peek().equals(i)); } assertNull(q.peek()); } /**
526527528529530531532533534535536
assertEquals(i, q.peek()); assertEquals(i, q.poll()); assertTrue(q.peek() == null || !q.peek().equals(i)); } assertNull(q.peek()); } /** * element returns next element, or throws NSEE if empty */