code: private long clampToBounds(EventJournal<J> journal, int partitionId, long requestedSequence) {
          final long oldestSequence = journal.oldestSequence(namespace, partitionId);
          final long newestSequence = journal.newestSequence(namespace, partitionId);
  
          // fast forward if late and no store is configured
          if (requestedSequence < oldestSequence && !journal.isPersistenceEnabled(namespace, partitionId)) {
              return oldestSequence;
          }
  
          // jump back if too far in future
          if (requestedSequence > newestSequence + 1) {
              return newestSequence + 1;
          }
          return requestedSequence;
      }
docs: Checks if the provided {@code requestedSequence} is within bounds of the
  oldest and newest sequence in the event journal. If the
  {@code requestedSequence} is too old or too new, it will return the
  current oldest or newest journal sequence.
  This method can be used for a loss-tolerant reader when trying to avoid a
  {@link com.hazelcast.ringbuffer.StaleSequenceException}.
  
  @param journal           the event journal
  @param partitionId       the partition ID to read
  @param requestedSequence the requested sequence to read
  @return the bounded journal sequence