code: private boolean verifyRecordInRange(
        final PartitionIdType partition,
        final SequenceOffsetType recordOffset
    )
    {
      // Verify that the record is at least as high as its currOffset.
      final SequenceOffsetType currOffset = Preconditions.checkNotNull(
          currOffsets.get(partition),
          "Current offset is null for sequenceNumber[%s] and partition[%s]",
          recordOffset,
          partition
      );
  
      final OrderedSequenceNumber<SequenceOffsetType> recordSequenceNumber = createSequenceNumber(recordOffset);
      final OrderedSequenceNumber<SequenceOffsetType> currentSequenceNumber = createSequenceNumber(currOffset);
  
      final int comparisonToCurrent = recordSequenceNumber.compareTo(currentSequenceNumber);
      if (comparisonToCurrent < 0) {
        throw new ISE(
            "Record sequenceNumber[%s] is smaller than current sequenceNumber[%s] for partition[%s]",
            recordOffset,
            currOffset,
            partition
        );
      }
  
      // Check if the record has already been read.
      if (isRecordAlreadyRead(partition, recordOffset)) {
        return false;
      }
  
      // Finally, check if this record comes before the endOffsets for this partition.
      return isMoreToReadBeforeReadingRecord(recordSequenceNumber.get(), endOffsets.get(partition));
    }
docs: This method does two things:
  
  1) Verifies that the sequence numbers we read are at least as high as those read previously, and throws an
  exception if not.
  2) Returns false if we should skip this record because it's either (a) the first record in a partition that we are
  needing to be exclusive on; (b) too late to read, past the endOffsets.