static int smartIndexOfNot(L l, A sub) { int i = 0, n = l(l); while (i < n && eq(l.get(i), sub)) ++i; ret i; }