public boolean matches(final LocalTieredStorageCondition condition) {
        if (brokerId != condition.brokerId) {
            return false;
        }
        if (condition.eventType != type) {
            return false;
        }
        if (!segmentId.topicIdPartition().topicPartition().equals(condition.topicPartition)) {
            return false;
        }
        if (!exception.map(e -> condition.failed).orElseGet(() -> !condition.failed)) {
            return false;
        }
        if (condition.baseOffset != null && !metadata.isPresent()) {
            return false;
        }
        if (condition.baseOffset != null && metadata.get().startOffset() != condition.baseOffset) {
            return false;
        }
        return true;
    }
Assess whether this event matches the characteristics of an event specified by the {@code condition}.

@param condition The condition which contains the characteristics to match.
@return true if this event matches the condition's characteristics, false otherwise.
storage/src/test/java/org/apache/kafka/server/log/remote/storage/LocalTieredStorageEvent.java