### Question:
ArrayRingBuffer extends AbstractBoundedQueue<T> implements Iterable<T> { @Override public T peek() throws RuntimeException { if (isEmpty()) { throw new RuntimeException("Ring buffer underflow"); } else { return rb[first]; } } ArrayRingBuffer(int capacity); @Override Iterator<T> iterator(); @Override void enqueue(T x); @Override T dequeue(); @Override T peek();  }### Answer:
@Test public void testPeek() { BoundedQueue<Integer> arb = new ArrayRingBuffer<>(10); for (int i = 0; i < arb.capacity(); i += 1) { arb.enqueue(i); } for (int i = 0; i < 5; i += 1) { arb.dequeue(); } assertEquals((int) arb.peek(), 5); }