@Override
    public int size() {
        long head = headSequence.get();
        long tail = tailSequence.get();

        if (tail == UNSET) {
            return 0;
        }

        return (int) (tail - head + 1);
    }
@Test
    public void testBufferSize_whenEmpty() {
        int maxCapacity = nextPowerOfTwo(10);
        CyclicBuffer<TestSequenced> buffer = new DefaultCyclicBuffer<>(maxCapacity);

        assertEquals("item count should be = " + 0, 0, buffer.size());
    }