@Override
    public boolean shouldWait() {
        RingbufferContainer ringbuffer = getRingBufferContainerOrNull();
        if (ringbuffer == null) {
            return true;
        }
        if (ringbuffer.isTooLargeSequence(sequence) || ringbuffer.isStaleSequence(sequence)) {
            //no need to wait, let the operation continue and fail in beforeRun
            return false;
        }
        // the sequence is not readable
        return sequence == ringbuffer.tailSequence() + 1;
    }
@Test
    public void whenOnTailAndBufferEmpty() {
        ReadOneOperation op = getReadOneOperation(ringbuffer.tailSequence());

        // since there is an item, we don't need to wait
        op.shouldWait();
        assertThrows(StaleSequenceException.class, op::beforeRun);
    }