public FilteredIterable retain()

in core/src/main/java/org/apache/commons/functor/core/collection/FilteredIterable.java [153:168]


    public FilteredIterable<T> retain(final Class<?>... ofType) {
        if (ofType == null) {
            throw new NullPointerException("array of filtered types was null");
        }
        return retain(new Predicate<T>() {

            public boolean test(T obj) {
                for (Class<?> type : ofType) {
                    if (type.isInstance(obj)) {
                        return true;
                    }
                }
                return false;
            }
        });
    }