Files
kotlin/compiler/testData/codegen/boxWithStdlib/jdkAnnotations/hashMap.kt
2013-02-11 02:01:41 +04:00

16 lines
447 B
Kotlin

import java.util.*
fun box(): String {
val map: MutableMap<String, Int> = HashMap<String, Int>()
map.put("a", 1)
map.put("bb", 2)
map.put("ccc", 3)
map.put("dddd", 4)
if (map.get("a") != 1) return "fail 1"
if (map.size() != 4) return "fail 2"
if (map.get("eeeee") != null) return "fail 3"
if (!map.containsKey("bb")) return "fail 4"
if (map.entrySet().contains("ffffff")) return "fail 5"
return "OK"
}