@Test
public void size() throws BufferException {

    ByteBuffer buffer = new ByteBuffer();
    Assert.assertEquals(0, buffer.size());
    buffer.add((byte)10);
    Assert.assertEquals(1, buffer.size());
    for (int i = 0; i < 10; i++)
        buffer.add((byte)10);
    Assert.assertEquals(11, buffer.size());
}