class MyIterator(val v: T): Iterator { override fun next(): T = v override fun hasNext(): Boolean = true } fun box(): String { try { (MyIterator("") as MutableIterator).remove() throw AssertionError() } catch (e: UnsupportedOperationException) { return "OK" } }