public LeaderEpochFileCache withCheckpoint(LeaderEpochCheckpointFile leaderEpochCheckpoint) {
        lock.readLock().lock();
        try {
            return new LeaderEpochFileCache(epochEntries(),
                                            topicPartition,
                                            leaderEpochCheckpoint,
                                            scheduler);
        } finally {
            lock.readLock().unlock();
        }
    }
Returns a new LeaderEpochFileCache which contains same
epoch entries with replacing backing checkpoint file.
@param leaderEpochCheckpoint the new checkpoint file
@return a new LeaderEpochFileCache instance
storage/src/main/java/org/apache/kafka/storage/internals/epoch/LeaderEpochFileCache.java