class Selectors {

    public static <T> SelectorFunction<Collection<T>, T> filtered(@NonNull final SelectorFunction<Collection<T>, T> selector,
                                                   @NonNull final Predicate<T> predicate) {
        return new SelectorFunction<Collection<T>, T>() {
            @Override
            public T select(Collection<T> items) {
                return selector.select(
                        filteredItems(items, predicate)
                );
            }
        };
    }

}