static int tripleIndexOf(T3 t, A a) { if (t == null) ret -1; if (eq(t.a), a)) ret 0; if (eq(t.b), a)) ret 1; if (eq(t.c), a)) ret 2; ret -1; }