@Test public void testResize() { CircularQueue cq = new CircularQueue(1); Assert.assertEquals(1, cq.capacity()); Assert.assertEquals(0, cq.size()); cq.enqueue(1); cq.enqueue(2); Assert.assertEquals(2, cq.capacity()); Assert.assertEquals(2, cq.size()); }
private void resize() { LOGGER.debug("Resizing queue from {} to {}.", capacity, capacity * 2); queue = Arrays.copyOf(queue, capacity *= 2); }
CircularQueue { private void resize() { LOGGER.debug("Resizing queue from {} to {}.", capacity, capacity * 2); queue = Arrays.copyOf(queue, capacity *= 2); } }
CircularQueue { private void resize() { LOGGER.debug("Resizing queue from {} to {}.", capacity, capacity * 2); queue = Arrays.copyOf(queue, capacity *= 2); } CircularQueue();  CircularQueue(final int capacity); }
CircularQueue { private void resize() { LOGGER.debug("Resizing queue from {} to {}.", capacity, capacity * 2); queue = Arrays.copyOf(queue, capacity *= 2); } CircularQueue();  CircularQueue(final int capacity); int size(); int capacity(); int enqueue(int element); int dequeue(); boolean isEmpty(); }
CircularQueue { private void resize() { LOGGER.debug("Resizing queue from {} to {}.", capacity, capacity * 2); queue = Arrays.copyOf(queue, capacity *= 2); } 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; }