Add equals(Object) and hashCode() methods to constraints