An implementation of the union-find data structure (disjoint set forests) in Java