public union(other as HashSetSync<T>) as HashSetSync<T>:
Returns a new synchronized set containing all elements from this set and other.
| Parameter | Description |
|---|---|
other | Elements to merge with this set. |
A new synchronized hash set containing the union.
import klyn.collections
left = s:{1, 2, 3}
right = s:{3, 4}
merged = left.union(right)
assert merged.size == 4
assert 4 in merged