static A firstInstanceOf(Iterable i, Class c) { if (i == null) null; c = primitiveToBoxedTypeOpt(c); for (O o : i) if (isInstance(c, o)) ret (A) o; null; } static A firstInstanceOf(Class c, Iterable i) { ret firstInstanceOf(i, c); } static A firstInstanceOf(O[] a, Class c) { if (a == null) null; c = primitiveToBoxedTypeOpt(c); for (O o : a) if (isInstance(c, o)) ret (A) o; null; }