toSet

fun toSet(): Set<E>

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

Here's a simple usage example:

val notEmptySet: NotEmptySet<Int> = notEmptySetOf(1, 2, 3, 1)
val set: Set<Int> = notEmptySet.toSet()
println(set) // [1, 2, 3]