public OptionalInt previousEpoch() {
        lock.readLock().lock();
        try {
            Optional<Map.Entry<Integer, EpochEntry>> lowerEntry = latestEntry().flatMap(entry -> Optional.ofNullable(epochs.lowerEntry(entry.epoch)));
            return lowerEntry.isPresent() ? OptionalInt.of(lowerEntry.get().getKey()) : OptionalInt.empty();
        } finally {
            lock.readLock().unlock();
        }
    }
Returns the current Leader Epoch if one exists. This is the latest epoch
which has messages assigned to it.
storage/src/main/java/org/apache/kafka/storage/internals/epoch/LeaderEpochFileCache.java