public
void test0() {
int size = 2;
CyclicBuffer cb = new CyclicBuffer(size);
assertEquals(cb.getMaxSize(), size);
cb.add(e[0]);
assertEquals(cb.length(), 1);
assertEquals(cb.get(), e[0]); assertEquals(cb.length(), 0);
assertNull(cb.get()); assertEquals(cb.length(), 0);
cb = new CyclicBuffer(size);
cb.add(e[0]);
cb.add(e[1]);
assertEquals(cb.length(), 2);
assertEquals(cb.get(), e[0]); assertEquals(cb.length(), 1);
assertEquals(cb.get(), e[1]); assertEquals(cb.length(), 0);
assertNull(cb.get()); assertEquals(cb.length(), 0);
}