CircularBuffer { public boolean isFull(){ return availableReadLength == size; } CircularBuffer(final int size); void write(final byte data); void readAll(final OutputStream outputStream); void readChunk(final OutputStream outputStream, final int chunkSize); boolean isFull(); boolean isEmpty(); int getAvailableDataLength(); int getBufferSize(); void reset();  }
@Test public void testIsFull() throws Exception { final CircularBuffer buffer = new CircularBuffer(10); byte[] chunk1 = {0x01, 0x02, 0x03, 0x04, 0x05}; writeDataToCircularBuffer(buffer, chunk1); Assert.assertFalse(buffer.isFull()); byte[] chunk2 = {0x06, 0x07, 0x08, 0x09, 0x10}; writeDataToCircularBuffer(buffer, chunk2); assertTrue(buffer.isFull()); }