Esempio n. 1
0
 public static <T> Predicate<T> and(Predicate<T> left, Predicate<T> right) {
   if (left == TRUE) {
     return right;
   }
   if (right == TRUE) {
     return left;
   }
   return (left == FALSE || right == FALSE) ? Is.<T>false_() : new AndPredicate<T>(left, right);
 }
Esempio n. 2
0
 public static <T> Predicate<T> or(Predicate<T> left, Predicate<T> right) {
   if (left == FALSE) {
     return right;
   }
   if (right == FALSE) {
     return left;
   }
   return (left == TRUE || right == TRUE) ? Is.<T>true_() : new OrPredicate<T>(left, right);
 }