/guava/guava/src/com/google/common/base/PairwiseEquivalence.java
Iterator<T> iteratorA = iterableA.iterator ( ) ; Iterator<T> iteratorB = iterableB.iterator ( ) ;
final Equivalence<E> elementEquivalence; PairwiseEquivalence(Equivalence<E> elementEquivalence) { this.elementEquivalence = Preconditions.checkNotNull(elementEquivalence); } @Override protected boolean doEquivalent(Iterable<T> iterableA, Iterable<T> iterableB) { <extra_id_0> while (iteratorA.hasNext() && iteratorB.hasNext()) { if (!elementEquivalence.equivalent(iteratorA.next(), iteratorB.next())) { return false; } } return !iteratorA.hasNext() && !iteratorB.hasNext();