// FILE: test.kt class Test : Base { constructor(f: () -> String) : super(f) } fun box() = Test({ "OK" }).get() // FILE: Supplier.java public interface Supplier { T get(); } // FILE: Base.java public class Base { private final Supplier supplier; public Base(Supplier supplier) { this.supplier = supplier; } public String get() { return supplier.get(); } }