public List<EpochEntry> epochEntriesInRange(long startOffset, long endOffset) {
        lock.readLock().lock();
        try {
            TreeMap<Integer, EpochEntry> epochsCopy = new TreeMap<>(this.epochs);
            if (startOffset >= 0) {
                truncateFromStart(epochsCopy, startOffset);
            }
            truncateFromEnd(epochsCopy, endOffset);
            return new ArrayList<>(epochsCopy.values());
        } finally {
            lock.readLock().unlock();
        }
    }
Returns the leader epoch entries within the range of the given start and end offset
@param startOffset The start offset of the epoch entries (inclusive).
@param endOffset   The end offset of the epoch entries (exclusive)
@return the leader epoch entries
storage/src/main/java/org/apache/kafka/storage/internals/epoch/LeaderEpochFileCache.java