mergeSetsOf method from DisjunctSets implemented