inline fun <reified T : Any> mock(): T
(source)
Dynamically create a mock object. This method is helpful when creating mocks of classes using generics.
Instead of: val foo = Mockito.mock(....Class of Bar?...)
You can just use: val foo: Bar = mock()