kotlin.collections.mapOf
mapOf
fun <K, V> mapOf(vararg pairs: Pair<K, V>): Map<K, V>
Returns a new read-only map with the specified contents, given as a list of pairs where the first value is the key and the second is the value. If multiple pairs have the same key, the resulting map will contain the value from the last of those pairs.
Entries of the map are iterated in the order they were specified. The returned map is serializable (JVM).
import kotlin.test.*
import java.util.*
import kotlin.comparisons.*
fun main(args: Array<String>) {
//sampleStart
val map = mapOf(1 to "x", 2 to "y", -1 to "zz"