toSet

fun toSet(): Set<E>

Returns all elements of this set as a Set of type E.


Calling from Kotlin

Here's an example of calling this method from Kotlin code:

val integers: NotEmptySet<Int> = notEmptySetOf(1, 2, 3, 1)
val actual: Set<Int> = integers.toSet()
val expected: Set<Int> = setOf(1, 2, 3)
assertEquals(expected, actual)