public static Predicate instance()

in core/src/main/java/org/apache/commons/functor/core/collection/IsElementOf.java [139:149]


    public static <A> Predicate<A> instance(Object obj) {
        if (null == obj) {
            throw new NullPointerException("Argument must not be null");
        } else if (obj instanceof Collection<?>) {
            return new RightBoundPredicate<A>(new IsElementOf<A, Object>(), obj);
        } else if (obj.getClass().isArray()) {
            return new RightBoundPredicate<A>(new IsElementOf<A, Object>(), obj);
        } else {
            throw new IllegalArgumentException("Expected Collection or Array, found " + obj.getClass());
        }
    }