public List<LocalTieredStorageEvent> getEvents(final EventType type, final TopicPartition topicPartition) {
        List<LocalTieredStorageEvent> matchingTypeEvents = history.get(type);

        synchronized (matchingTypeEvents) {
            matchingTypeEvents = new ArrayList<>(matchingTypeEvents);
        }

        return matchingTypeEvents.stream().filter(matches(topicPartition)).collect(Collectors.toList());
    }
Returns the list of events accumulated by this instance of history from the {@link LocalTieredStorage}
it captures events from.

@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 list of events accumulated in this instance.
storage/src/test/java/org/apache/kafka/server/log/remote/storage/LocalTieredStorageHistory.java