Negate an existing predicate's test result.

@param predicate An existing predicate.
@param <T>       type of the predicate.
@return new predicate.
@since 1.5
162225
public static <T> Predicate<T> negate(final Predicate<? super T> predicate) {
        return new Predicate<T>() {
            @Override
            public boolean test(final T testValue) {
                return !predicate.test(testValue);
            }
        };
    }
338212
public static <T extends Comparable<? super T>> Predicates<T> betweenInclusiveFrom(T from, T to)
    {
        Predicates.failIfDifferentTypes(from, to);
        return new BetweenInclusiveFrom<T>(from, to);
    }
895877
public static <T1, T2, T3> TriPredicate<T1, T2, T3> not(TriPredicate<T1, T2, T3> predicate) {
        dbc.precondition(predicate != null, "cannot negate a null predicate");
        return predicate.negate();
    }
1771
public Optional<T> filter(final Predicate<? super T> predicate) {
        if (isPresent() && predicate.test(get())) {
            return this;
        }

        return empty();
    }
649259
@Beta
    public static <T> Predicate<T> nor(Predicate<? super T> first, Predicate<? super T> second) {
        return com.google.common.base.Predicates.not(com.google.common.base.Predicates.or(first, second));
    }
513082
public EasyRandomParameters excludeType(Predicate<Class<?>> predicate) {
        Objects.requireNonNull(predicate, "Predicate must not be null");
        typeExclusionPredicates.add(predicate);
        exclusionRandomizerRegistry.addTypePredicate(predicate);
        return this;
    }
244933
public static <T> List<T> filter( Iterable<T> collection, Predicate<T> predicate)
    {
        List<T> filtered = new ArrayList<T>();
        for (T element : collection)
        {
        	if (predicate.isVerifiedBy(element))
        	{
        		filtered.add(element);
        	}
        }
        return filtered;
    }
718829
public static <T> Predicate<T> not(final Predicate<? super T> p) {
    return new Predicate<T>() {
      @Override
      public boolean apply(T obj) {
        return !p.apply(obj);
      }
    };
  }
654917
@Contract(value = " -> new", pure = true)
	@NotNull
	public static <T> BiPredicate<T, Throwable> isResult() {
		return ($, e) -> e == null;
	}
186737
public RetryPolicy<R> abortOn(Predicate<? extends Throwable> failurePredicate) {
    Assert.notNull(failurePredicate, "failurePredicate");
    abortConditions.add(failurePredicateFor(failurePredicate));
    return this;
  }
1198732
public static <V> Predicate<TaskContext<V>> ifResult(Predicate<V> predicate) {
        return ctx -> predicate.test(ctx.getResult());
    }
760657
@NotNull
    public OptionalDouble filterNot(@NotNull DoublePredicate predicate) {
        return filter(DoublePredicate.Util.negate(predicate));
    }
760409
@Nonnull
  public static <T> Predicate<T> predicate(@Nonnull final Function<T, Boolean> predicate) {
    return predicate::apply;
  }
924951
public void invalidateAll(Predicate<? super C> predicate) {
        cache.invalidateAll(Sets.filter(cache.asMap().keySet(), predicate));
    }
773629
public static <T> Predicate<T> always() {
        return new Predicate<T>() {
            @Override
            public boolean test( T input ) {
                return true;
            }
        };
    }
1351450
public static <T> Collector<T, ?, Boolean> allMatch(Predicate<? super T> predicate) {
        return Collector.of(
            () -> new Boolean[1],
            (a, t) -> {
                if (a[0] == null)
                    a[0] = predicate.test(t);
                else
                    a[0] = a[0] && predicate.test(t);
            },
            (a1, a2) -> {
                a1[0] = a1[0] && a2[0];
                return a1;
            },
            a -> a[0] == null || a[0]
        );
    }
123181
public static <T> Predicate<T> ignore(BooleanSupplier proposition, Class<T> ignored) {
        dbc.precondition(proposition != null, "cannot ignore parameter of a null proposition");
        return t -> proposition.getAsBoolean();
    }