static A resetFields(A object, S fields) { if (object == null) ret; O emptyInstance = newInstance(object.getClass()); for (S field : identifiers(fields)) setOpt(object, field, getOpt(emptyInstance, field)); ret object; }