@Override
    public boolean shouldWait() {
        RingbufferContainer ringbuffer = getRingBufferContainerOrNull();

        if (resultSet == null) {
            resultSet = new ReadResultSetImpl<>(minSize, maxSize, getNodeEngine().getSerializationService(), filter);
            sequence = startSequence;
        }

        if (ringbuffer == null) {
            return minSize > 0;
        }

        sequence = ringbuffer.clampReadSequenceToBounds(sequence);

        if (minSize == 0) {
            if (sequence < ringbuffer.tailSequence() + 1) {
                readMany(ringbuffer);
            }

            return false;
        }

        if (resultSet.isMinSizeReached()) {
            // enough items have been read, we are done.
            return false;
        }

        if (sequence == ringbuffer.tailSequence() + 1) {
            // the sequence is not readable
            return true;
        }
        readMany(ringbuffer);
        return !resultSet.isMinSizeReached();
    }
@Test
    public void whenOneAfterTail() {
        ringbuffer.add("tail");

        ReadManyOperation op = getReadManyOperation(ringbuffer.tailSequence() + 1, 1, 1, null);

        // since there is an item, we don't need to wait
        boolean shouldWait = op.shouldWait();
        assertTrue(shouldWait);

        ReadResultSetImpl response = getReadResultSet(op);
        assertEquals(0, response.readCount());
        assertEquals(0, response.getNextSequenceToReadFrom());
    }