@Test public void testDequeue() { queue.enqueue(11); queue.enqueue(12); queue.enqueue(13); Assert.assertEquals(11, queue.dequeue()); Assert.assertEquals(CircularQueue.DEFAULT_CAPACITY, queue.capacity()); Assert.assertEquals(2, queue.size()); }
public int dequeue() { if (isEmpty()) { throw new NoSuchElementException("Cannot dequeue from an empty queue."); } return queue[begin++]; }
CircularQueue { public int dequeue() { if (isEmpty()) { throw new NoSuchElementException("Cannot dequeue from an empty queue."); } return queue[begin++]; } }
CircularQueue { public int dequeue() { if (isEmpty()) { throw new NoSuchElementException("Cannot dequeue from an empty queue."); } return queue[begin++]; } CircularQueue();  CircularQueue(final int capacity); }
CircularQueue { public int dequeue() { if (isEmpty()) { throw new NoSuchElementException("Cannot dequeue from an empty queue."); } return queue[begin++]; } CircularQueue();  CircularQueue(final int capacity); int size(); int capacity(); int enqueue(int element); int dequeue(); boolean isEmpty(); }
CircularQueue { public int dequeue() { if (isEmpty()) { throw new NoSuchElementException("Cannot dequeue from an empty queue."); } return queue[begin++]; } CircularQueue();  CircularQueue(final int capacity); int size(); int capacity(); int enqueue(int element); int dequeue(); boolean isEmpty(); static final Logger LOGGER; static final int DEFAULT_CAPACITY; }