}
if (constraint instanceof Or) {
Or or = (Or)constraint;
Constraint left = replaceReferences(context, or.left(), mapping, node);
Constraint right = replaceReferences(context, or.right(), mapping, node);
if (left == or.left() && right == or.right()) return or;
return new Or(left, right);
}
if (constraint instanceof Not) {
Not not = (Not)constraint;
Constraint wrapped = replaceReferences(context, not.getConstraint(), mapping, node);