Replacing Lists with SortedSets to facilitate compare the entity trees.