Kotlin unit test failing when using generics and Mockito

Add helper function somewhere in your test package:

inline fun <reified T: Any> mock() = Mockito.mock(T::class.java)

and use it instead of Mockito’s:

val view: View<MyModel> = mock()

You can also use the following library which adds this and few other functions to better suit Mockito for Kotlin: GitHub - mockito/mockito-kotlin: Using Mockito with Kotlin