Adding equals and hashcode to RestrictedField