public static Predicate operator &(Predicate leftOperand, Predicate rightOperand)
{
bool leftIsTrue = leftOperand is TruePredicate;
bool rightIsTrue = rightOperand is TruePredicate;
if (leftIsTrue && rightIsTrue) {
return new TruePredicate();
}
if (leftIsTrue || rightIsTrue) {
return leftIsTrue ? rightOperand : leftOperand;
}
return new AndConditionalOperatorAndPredicate(leftOperand, rightOperand);
}