class A { fun add(element: T) {} } public fun foo(x: MutableCollection, block: java.util.AbstractList) { x.add(block.get(0)) }