I'm trying to mock a function in Kotlin
Mockito.mock(Function2<Int, Int, Unit>::class.java)
and it says "Only classes are allowed on the left hand side of a class literal". What's the proper way to obtain a reference to a statically known parameterized class? For now I live with an ugly cast
Mockito.mock(Function2::class.java) as (Int, Int) -> Unit