@Test
public void occurrencesWithOverlap() throws BufferException {

    ByteBuffer buffer = new ByteBuffer(TEST_BYTES2);
    Assert.assertEquals(-1, buffer.occurrences(new byte[0]));
    Assert.assertEquals(1, buffer.occurrences(TEST_C));
    Assert.assertEquals(4, buffer.occurrences(TEST_AA));
    Assert.assertEquals(2, buffer.occurrences(TEST_AB));
    Assert.assertEquals(3, buffer.occurrences(TEST_BB));
}