Add tests for Quick-union algorithm