// FILE: J.java import java.util.*; public class J { private static class MyMap extends KMap {} public static String foo() { Map collection = new MyMap(); if (!collection.containsKey("ABCDE")) return "fail 1"; if (!collection.containsValue(1)) return "fail 2"; return "OK"; } } // FILE: test.kt open class KMap : Map { override val size: Int get() = throw UnsupportedOperationException() override fun isEmpty(): Boolean { throw UnsupportedOperationException() } override fun containsKey(key: K) = true override fun containsValue(value: V) = true override fun get(key: K): V? { throw UnsupportedOperationException() } override val keys: Set get() = throw UnsupportedOperationException() override val values: Collection get() = throw UnsupportedOperationException() override val entries: Set> get() = throw UnsupportedOperationException() } fun box() = J.foo()