I was writing a small piece of code in which I internally handle my data in a mutable map, which in turn has mutable lists.
I wanted to expose my data to the API use
Simply call toMap() on your MutableMap.
toMap()
MutableMap
val myMap = mutableMapOf("x" to "y").toMap()
Done.
The same also works for lists.