Predicate
Predicate<Integer> predicate;
Boolean result;
// Predicate initialization is skipped
result = predicate.test(12);Logical Operations
Predicate<Integer> predicate1;
Predicate<Integer> predicate2;
Predicate<Integer> alwaysTrue;
Predicate<Integer> alwaysFalse;
Predicate<Integer> both;
Predicate<Integer> one;
// Predicate initialization is skipped
// True if both are true
both = predicate1.and(predicate2);
// True if one is true
one = predicate1.or(predicate2);
// Reversed
alwaysFalse = alwaysTrue.negate();Extensions
Last updated