This optimisation breaks duplication check of newly created items.
For example, Segment with extremities swapped will be check as different models but there are the same.
It is because the hash value of the segment parents collection will be different.
parents1 = A, B
parents2 = B, A
=> parents1 hash ~= parents2 hash
Turning parents asSet produce two identical hash value,
May be some model should have parents collection as Set, or all models.
The implication of this change should be evaluated.
This optimisation breaks duplication check of newly created items.
For example, Segment with extremities swapped will be check as different models but there are the same.
It is because the hash value of the segment parents collection will be different.
parents1 = A, B
parents2 = B, A
=> parents1 hash ~= parents2 hash
Turning parents asSet produce two identical hash value,
May be some model should have parents collection as Set, or all models.
The implication of this change should be evaluated.