return BoundedBuffer.decorate(new UnboundedFifoBuffer(), 1);
}
//-----------------------------------------------------------------------
public void testMaxSize() {
final Buffer bounded = BoundedBuffer.decorate(new UnboundedFifoBuffer(), 2, 500);
BoundedCollection bc = (BoundedCollection) bounded;
assertEquals(2, bc.maxSize());
assertEquals(false, bc.isFull());
bounded.add("A");
assertEquals(false, bc.isFull());
bounded.add("B");
assertEquals(true, bc.isFull());
bounded.remove();
assertEquals(false, bc.isFull());
try {
BoundedBuffer.decorate(new UnboundedFifoBuffer(), 0);
fail();
} catch (IllegalArgumentException ex) {}