of

@ExperimentalSince(version = KotoolsTypesVersion.V4_5_0)
fun <E> of(head: E, vararg tail: E): NotEmptySet<E>

Creates a NotEmptySet starting with a head and containing all the elements of the optional tail.

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

val integers: NotEmptySet<Int> = NotEmptySet.of(1, 2, 3, 1)
println(integers) // [1, 2, 3]

The NotEmptySet type being an inline value class, this function is not available yet for Java users.