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