@Test public void testPeek() { queue.offer("hello"); queue.add("world"); assertEquals("hello", queue.peek()); }
public E peek() { if (size == 0) return null; return objects[remove]; }
SimpleBoundedQueue extends AbstractQueue<E> { public E peek() { if (size == 0) return null; return objects[remove]; } }
SimpleBoundedQueue extends AbstractQueue<E> { public E peek() { if (size == 0) return null; return objects[remove]; } SimpleBoundedQueue(int maxSize); }
SimpleBoundedQueue extends AbstractQueue<E> { public E peek() { if (size == 0) return null; return objects[remove]; } SimpleBoundedQueue(int maxSize); @Override boolean add(E obj); E pop(); @Override int size(); int remainingCapacity(); boolean offer(E o); E peek(); E poll(); @Override void clear(); @Override Iterator<E> iterator(); }
SimpleBoundedQueue extends AbstractQueue<E> { public E peek() { if (size == 0) return null; return objects[remove]; } SimpleBoundedQueue(int maxSize); @Override boolean add(E obj); E pop(); @Override int size(); int remainingCapacity(); boolean offer(E o); E peek(); E poll(); @Override void clear(); @Override Iterator<E> iterator();  }