static void zeroAllFieldsOfType(O o, Class type) { for (S field : allFields(o)) if (instanceOf(type, getOpt(o, field))) set(o, field := null); }