Quick Union in Java