Hey guys. I have a following class: ``` class Mult...
# announcements
a
Hey guys. I have a following class:
Copy code
class MultiMap<K, V> : HashMap<K, MutableList<V>>() {

    fun put(key: K, value: V) {
        var entries = get(key)

        if (entries == null) {
            entries = mutableListOf<V>()
            put(key, entries)
        }

        entries.add(value)
    }
}
That in Java Spring project fails to compile with:
Copy code
MultiMap.kt: (5, 7): Inherited platform declarations clash: The following declarations have the same JVM signature (getOrDefault(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;):
    fun getOrDefault(key: K, defaultValue: MutableList<V>): MutableList<V>
    fun getOrDefault(key: Any!, defaultValue: MutableList<V>!): MutableList<V>!
What would a proper fix?