assertTrue(rq.size() == 0);
}
public void testBoundedQueue() {
Integer[] a = mkRandom();
RingQueue<Integer> rq = new RingQueue(10, a.length);
for (int i = 0; i < a.length; i++) {
assertTrue("put returned false", rq.put(a[i]));
}
assertFalse("put should not accept more than bound", rq.put(100));
assertTrue(rq.size() == a.length);
for (int i = 0; i < a.length; i++) {
assertEquals("get[" + i + " ]returned different element", a[i], rq.get());
}
// No more elements. The next had better be null
assertNull("Queue should not have any more elements", rq.get());
assertTrue(rq.size() == 0);
}