/** * Returns an empty BoundedFifoBuffer that won't overflow. * * @return an empty BoundedFifoBuffer */ public Collection makeCollection() { return new BoundedFifoBuffer(100); }
/** * Tests that the constructor correctly throws an exception. */ public void testConstructorException3() { try { new BoundedFifoBuffer(null); } catch (NullPointerException ex) { return; } fail(); } }
/** * Tests that the constructor correctly throws an exception. */ public void testConstructorException1() { try { new BoundedFifoBuffer(0); } catch (IllegalArgumentException ex) { return; } fail(); }
/** * Tests that the constructor correctly throws an exception. */ public void testConstructorException2() { try { new BoundedFifoBuffer(-20); } catch (IllegalArgumentException ex) { return; } fail(); }
/** * Returns a BoundedFifoBuffer that's filled to capacity. * Any attempt to add to the returned buffer will result in a * BufferOverflowException. * * @return a full BoundedFifoBuffer */ public Collection makeFullCollection() { return new BoundedFifoBuffer(Arrays.asList(getFullElements())); }
final BoundedFifoBuffer buffer = new BoundedFifoBuffer( Math.max( m_components.size(), 1 ) );