@Test public void testAdd() { queue.add("hello"); assertEquals("hello", queue.poll()); }
@Override public boolean add(E obj) { if (size == maxSize) { return false; } objects[add] = obj; add++; size++; if (add == maxSize) { add = 0; } return true; }
SimpleBoundedQueue extends AbstractQueue<E> { @Override public boolean add(E obj) { if (size == maxSize) { return false; } objects[add] = obj; add++; size++; if (add == maxSize) { add = 0; } return true; } }
SimpleBoundedQueue extends AbstractQueue<E> { @Override public boolean add(E obj) { if (size == maxSize) { return false; } objects[add] = obj; add++; size++; if (add == maxSize) { add = 0; } return true; } SimpleBoundedQueue(int maxSize); }
SimpleBoundedQueue extends AbstractQueue<E> { @Override public boolean add(E obj) { if (size == maxSize) { return false; } objects[add] = obj; add++; size++; if (add == maxSize) { add = 0; } return true; } 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> { @Override public boolean add(E obj) { if (size == maxSize) { return false; } objects[add] = obj; add++; size++; if (add == maxSize) { add = 0; } return true; } 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();  }