notEmptyMapOf

@Since(version = KotoolsTypesVersion.V4_0_0)
fun <K, V> notEmptyMapOf(head: Pair<K, V>, vararg tail: Pair<K, V>): NotEmptyMap<K, V>

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


Calling from Kotlin

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

val map: NotEmptyMap<Char, Int> = notEmptyMapOf('a' to 1, 'b' to 2)
assertEquals(expected = "{a=1, b=2}", actual = "$map")