New unit test that asserts the transitivity property of UnionFind.union