static int indexOfDifference(Iterable i1, Iterable i2) { var it1 = iterator(i1); var it2 = iterator(i2); int i = 0; while ping (true) { bool a = it1.hasNext(), b = it2.hasNext(); if (a != b) ret i; if (!a) ret -1; A el1 = it1.next(); A el2 = it2.next(); if (!eq(el1, el2)) ret i; ++i; } }