**Puzzle**: When you have a SAM java interface, e....
# random
m
Puzzle: When you have a SAM java interface, e.g.
Copy code
interface SomeInterface {
    String someMethod();
}
you can write a stub for it simply like this:
val stub = SomeInterface { "some string" }
When having the same interface in Kotlin:
Copy code
interface SomeInterface2 {
    fun someMethod(): String
}
you have to write it more verbosely:
Copy code
val stub2 = object : SomeInterface2 {
    override fun someMethod() = "some string"
}
What can you do to make it look better when using Kotlin in both production and test code?
val stub2 = SomeInterface2 { "some string" }