static A findByField(Collection c, S field, O value) { for (A a : c) if (eq(getOpt(a, field), value)) ret a; ret null; }