Kotlin JUnit Mockito

I’m running into something similar.

``when(userService.save(any(User::class.java))).thenReturn(userStub)

Results in:

java.lang.IllegalStateException: any(User::class.java) must not be null

The method is question (userService.save(user: User!): User?) is not final or private (nor equals or hashCode, obviously)