@Override
    public boolean shouldWait() {
        if (resultSet == null) {
            resultSet = createResultSet();
            sequence = startSequence;
        }

        final EventJournal<J> journal = getJournal();
        final int partitionId = getPartitionId();
        journal.cleanup(namespace, partitionId);
        sequence = clampToBounds(journal, partitionId, sequence);

        if (minSize == 0) {
            if (!journal.isNextAvailableSequence(namespace, partitionId, sequence)) {
                readMany(journal, partitionId);
            }
            return false;
        }

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

        if (journal.isNextAvailableSequence(namespace, partitionId, sequence)) {
            // the sequence is not readable
            return true;
        }

        readMany(journal, partitionId);
        return !resultSet.isMinSizeReached();
    }
@ Override public boolean shouldWait ( ) { if ( resultSet == null ) { resultSet = createResultSet ( ) ; sequence = startSequence ; } final EventJournal < J > journal = getJournal ( ) ; final int partitionId = getPartitionId ( ) ; journal . cleanup ( namespace , partitionId ) ; sequence = clampToBounds ( journal , partitionId , sequence ) ; if ( minSize == 0 ) { if ( ! journal . isNextAvailableSequence ( namespace , partitionId , sequence ) ) { readMany ( journal , partitionId ) ; } return false ; } if ( resultSet . isMinSizeReached ( ) ) { return false ; } if ( journal . isNextAvailableSequence ( namespace , partitionId , sequence ) ) { return true ; } readMany ( journal , partitionId ) ; return ! resultSet . isMinSizeReached ( ) ; }
{@inheritDoc}
On every invocation this method reads from the event journal until
it has collected the minimum required number of response items.
Returns {@code true} if there are currently not enough
elements in the response and the operation should be parked.

@return if the operation should wait on the wait/notify key