union
Returns a set containing all distinct elements from both collections.
The returned set preserves the element iteration order of the original array. Those elements of the other collection that are unique are iterated in the end in the order of the other collection.
The returned set uses structural equality (==) to distinguish elements, meaning there will be no two structurally equal, but otherwise different elements in it.
To get a set containing all elements that are contained in both collections use intersect.
Since Kotlin
1.0Returns a set containing all distinct elements from both collections.
The returned set preserves the element iteration order of the original collection. Those elements of the other collection that are unique are iterated in the end in the order of the other collection.
The returned set uses structural equality (==) to distinguish elements, meaning there will be no two structurally equal, but otherwise different elements in it.
To get a set containing all elements that are contained in both collections use intersect.