public static LocalTieredStorageCondition expectEvent(final Iterable<LocalTieredStorage> storages,
                                                          final EventType eventType,
                                                          final int brokerId,
                                                          final TopicPartition tp,
                                                          final boolean failed,
                                                          final int latchCount) {
        final LocalTieredStorageCondition condition = new LocalTieredStorageCondition(eventType, brokerId, tp, failed, null, latchCount);
        storages.forEach(storage -> storage.addListener(condition.listener));
        return condition;
    }
Constructs a new condition on an interaction of the {@code eventType} nature, from the broker
with id {@code brokerId}, for the topic-partition {@code tp} and which is {@code failed} or not.

This condition internally observes the provided {@code storages} to intercept such an
interaction if it occurs.

NOTE: interactions with the {@code storages} is monitored as soon as this method returns.

@param storages The {@link LocalTieredStorage} which are subscribed to. Events generated by these
                storages will be captured and their attributes compared with the characteristics
                specified in this condition.
@param eventType The nature of the event to match.
@param brokerId The broker which should have generated the event.
@param tp The topic-partition which the event should relate to.
@param failed Whether the event should correspond to a failed interaction with the remote storage.
@param latchCount denotes the number of same kind of events to expect

@return A condition with the given characteristics which listens to the given storages and can
        be used to assess whether the expected event is encountered.
storage/src/test/java/org/apache/kafka/server/log/remote/storage/LocalTieredStorageCondition.java