CircularBuffer { public boolean isEmpty(){ return availableReadLength == 0; } 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 testIsEmpty() throws Exception { final CircularBuffer buffer = new CircularBuffer(10); assertTrue(buffer.isEmpty()); writeDataToCircularBuffer(buffer, new byte[]{0x01, 0x02, 0x03}); Assert.assertFalse(buffer.isEmpty()); writeDataToCircularBuffer(buffer, new byte[]{0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x10}); Assert.assertFalse(buffer.isEmpty()); writeDataToCircularBuffer(buffer, new byte[]{0x11}); Assert.assertFalse(buffer.isEmpty()); }