public OptionalLong latestSnapshotOffset() {
        Optional<SnapshotFile> snapshotFileOptional = latestSnapshotFile();
        return snapshotFileOptional.map(snapshotFile -> OptionalLong.of(snapshotFile.offset)).orElseGet(OptionalLong::empty);
    }
Get the last offset (exclusive) of the latest snapshot file.
storage/src/main/java/org/apache/kafka/storage/internals/log/ProducerStateManager.java