Update UnionFind.java

Correct an error