Implementation of Union-Find algorithms in java.