def test_union1(self):
     set1 = PersistentBalancedSet(5,
                                  iterator='preorder').insert(6).insert(7)
     set2 = None
     balancedSet = set1.union(set2)
     self.assertEqual(set1, [6, 5, 7])
     self.assertEqual(set2, None)
     self.assertEqual(balancedSet, [6, 5, 7])
 def test_union(self):
     set1 = PersistentBalancedSet(5,
                                  iterator='preorder').insert(6).insert(7)
     set2 = PersistentBalancedSet(3).insert(2).insert(1)
     balancedSet = set1.union(set2)
     self.assertEqual(set1, [6, 5, 7])
     self.assertEqual(set2, [1, 2, 3])
     self.assertEqual(balancedSet, [3, 2, 1, 6, 5, 7])
 def test_union2(self):
     set1 = PersistentBalancedSet(5, iterator='preorder').insert(6).insert(
         7).insert(4).insert(2).insert(1)
     set2 = PersistentBalancedSet(57, iterator='preorder').insert(
         36).insert(67).insert(24).insert(72).insert(4)
     balancedSet = set1.union(set2)
     self.assertEqual(set1, [4, 2, 1, 6, 5, 7])
     self.assertEqual(set2, [57, 24, 4, 36, 67, 72])
     self.assertEqual(balancedSet, [6, 2, 1, 4, 5, 57, 24, 7, 36, 67, 72])