@Test(expected = NoSuchElementException.class) public void testDequeueWhenEmpty() { queue.dequeue(); }
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; }