public Optional<LocalTieredStorageEvent> latestEvent(final EventType type, final TopicPartition topicPartition) {
        return getEvents(type, topicPartition).stream().max(Comparator.naturalOrder());
    }
Returns the latest event captured so far of the given type and relating to the given topic-partition.

@param type The type of the events to retrieve (e.g. offload or fetch a segment, fetch a time index, etc.)
@param topicPartition The topic-partition which the events relate to.
@return The latest event captured, if any. Otherwise, returns an empty value.
storage/src/test/java/org/apache/kafka/server/log/remote/storage/LocalTieredStorageHistory.java