of

@ExperimentalSince(version = KotoolsTypesVersion.V4_5_0)
fun <K, V> of(head: Pair<K, V>, vararg tail: Pair<K, V>): NotEmptyMap<K, V>

Creates a NotEmptyMap starting with the head and containing all the entries of the optional tail.

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

val map: NotEmptyMap<Char, Int> = NotEmptyMap.of('a' to 1, 'b' to 2)
println(map) // {a=1, b=2}

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