Turns a function that results in a boxed Boolean into a Predicate.

@param predicate The function.
@param <T>       The type of the argument of the function.
@return The same function as a Predicate.
760409
@Nonnull
  public static <T> Predicate<T> predicate(@Nonnull final Function<T, Boolean> predicate) {
    return predicate::apply;
  }
264830
public TemplateFilter where(Predicate<TemplateMetadata> predicate) {
        checkNotNull(predicate, "Predicate must be not a null");

        this.predicate = this.predicate.and(predicate);

        return this;
    }
516459
@SequentialOnly
    public static <T> Predicate<T> indexed(final IndexedPredicate<T> predicate) {
        return Predicates.indexed(predicate);
    }
98236
function getPredicateFunction(predicate) {
    let fn = predicate;
    if (_.isString(predicate)) {
        fn = node => (_.isFunction(node[predicate]) ? node[predicate]() : node[predicate]);
    }

    return fn;
}
1235529
public static <T> Predicate<T> trueInstance ()
    {
        @SuppressWarnings("unchecked") Predicate<T> pred = (Predicate<T>)TRUE_INSTANCE;
        return pred;
    }
1124302
@NotNull
    public OptionalDouble filter(@NotNull DoublePredicate predicate) {
        if (!isPresent()) return this;
        return predicate.test(value) ? this : OptionalDouble.empty();
    }
817136
public static <T, U> BiPredicate<T, U> biPredicate(CheckedBiPredicate<T, U> predicate) {
        return biPredicate(predicate, THROWABLE_TO_RUNTIME_EXCEPTION);
    }
102271
public static <T> Predicate<T> FALSE() {
	return Predicate.<T>NOT(Predicate.<T>TRUE());
    }
1351225
public static double[] selectByPredicate (double[] values, Boolean[] predicate) {
        return DMatrixUtils.selectByPredicate(values, ArrayUtils.toPrimitive(predicate));
    }
890995
public static <T> Predicate<T> spyRes(Predicate<T> predicate, Box<Boolean> result) {
        return spy(predicate, result, Box.<T>empty());
    }
778665
public <T> Predicate<T> in (final Collection<? extends T> target)
    {
        return new Predicate<T>() {
            public boolean apply (T arg) {
                try {
                    return target.contains(arg);
                } catch (NullPointerException e) {
                    return false;
                } catch (ClassCastException e) {
                    return false;
                }
            }
        };
    }
315394
public static <T> T find(T[] array, Predicate<T> predicate){
        if(array == null){
            return null;
        }
        for(T t: array){
            if(predicate.apply(t)){
                return t;
            }
        }
        return null;
    }
1368672
public static <T> Predicate<T> NOT(final Predicate<T> pred) {
	return new Predicate<T>() {
	    public boolean check(T obj) {
		return !pred.check(obj);
	    }
	};
    }
1328043
public static <T> Predicate<T> notNull() {
        return new Predicate<T>() {
            @Override
            public boolean test(T testValue) {
                return testValue != null;
            }
        };
    }
1299421
public static <T> Predicate<T> FULL_AND(final Predicate<T> a, final Predicate<T> b) {
	return new Predicate<T>() {
	    public boolean check(T obj) {
		return a.check(obj) & b.check(obj);
	    }
	};
    }
847922
@NotNull
    public Optional<T> filter(@NotNull Predicate<? super T> predicate) {
        if (!isPresent()) return this;
        return predicate.test(value) ? this : Optional.<T>empty();
    }
1146599
public final FluentCloseableIterable<T> filter(Predicate<? super T> predicate) {
        return from(CloseableIterables.filter(this, predicate));
    }