@Test
public void equals() throws BufferException {

    ByteBuffer buffer = createCircledByteBuffer(TEST_BYTES1.length);
    buffer.add(TEST_BYTES1);
    ByteBuffer buffer2 = createCircledByteBuffer(TEST_BYTES1.length);
    buffer2.add(TEST_BYTES1);
    // test normal case
    Assert.assertEquals(false, buffer.equals((Object)TEST_BYTES1));
    Assert.assertEquals(true, buffer.equals(buffer2));
    buffer2.remove();
    Assert.assertEquals(false, buffer.equals(buffer2));
    // test override for byte[]
    Assert.assertEquals(true, buffer.equals(TEST_BYTES1));
}