When comparing multi valued containment/references, you consider them unequal if the order is different. That order depends on the order they were added. Not sure how RGen deals with ordered vs. unordered. If it is always semantically "ordered", then the code above is ok. Otherwise you may want to consider to also support an unordered compare. (Which is a set operation if the relationship is unique) - if it is not unique, semantics gets tricky.