Add UnionFind without tests.