src/main/java/j2html/TagCreator.java
public static <T> List<T> filter(Collection<T> collection, Predicate<? super T> filter) {
        return collection.stream().filter(filter).collect(Collectors.toList());
    }
public static <T> List<T> filter(Collection<T> collection, Predicate<? super T> filter) {
        return collection.stream().filter(filter).collect(Collectors.toList());
    }
Filters a collection to a list, to be used with {@link j2html.TagCreator#each}
Intended usage: {@literal each(filter(numbers, n -> n % 2 == 0), n -> li(n.toString()))}

@param <T>        The derived generic parameter type
@param collection the collection to filter, ex: a list of values "1, 2, 3"
@param filter     the filter predicate, {@literal ex: "n -> n % 2 == 0"}
@return the filtered collection as a list (ex. docs: 2)