import java.* import java.util.* import utils.* import java.io.PrintStream import java.lang.Comparable as Com fun checkSubtype(t: T) = t val l : MutableList = ArrayList() fun test(l : List) { val x : java.List val y : List val b : java.lang.Object val a : java.util.List val z : java.utils.List val f : java.io.File? = null Collections.emptyList Collections.emptyList Collections.emptyList() Collections.emptyList() checkSubtype?>(Collections.singleton(1)) Collections.singleton(1.0) List val o = "sdf" as Object try { // ... } catch(e: Throwable) { System.out.println(e.message) } PrintStream("sdf") val c : Com? = null checkSubtype<java.lang.Comparable?>(c) // Collections.sort(ArrayList()) }