public Collection<LogSegment> filter(Predicate<LogSegment> predicate) {
        return values().stream().filter(predicate).collect(Collectors.toList());
    }
Returns an Iterable containing segments matching the provided predicate.

@param predicate the predicate to be used for filtering segments.
storage/src/main/java/org/apache/kafka/storage/internals/log/LogSegments.java