/** * Implements logical AND between the comparators results. Iterates through the comparators chain * until one of them returns false. If none returns false, this method returns true. * * @see EquivalenceComparator#equivalenceCompare(Object, Object, Object, Object) */ public boolean equivalenceCompare(E arg1, E arg2, C context1, C context2) { for (EquivalenceComparator<? super E, ? super C> currentComparator : this.chain) { if (!currentComparator.equivalenceCompare(arg1, arg2, context1, context2)) { return false; } } return true; }