code: Collection<FutureReadResultEntry> poll(long maxOffset) {
          List<FutureReadResultEntry> result = new ArrayList<>();
          synchronized (this.reads) {
              Exceptions.checkNotClosed(this.closed, this);
  
              // 'reads' is sorted by Starting Offset, in ascending order. As long as it is not empty and the
              // first entry overlaps the given offset by at least one byte, extract and return it.
              while (this.reads.size() > 0 && this.reads.peek().getStreamSegmentOffset() <= maxOffset) {
                  result.add(this.reads.poll());
              }
          }
  
          return result;
      }
docs: Finds the Result Entries that have a starting offset before the given offset, removes them from the collection,
  and returns them.
  
  @param maxOffset The offset to query against.