title: Can Mockito be used to match parameters that are functions in Kotlin?
body: <p>I have a function with a prototype similar to:</p>
  
  <pre><code>class objectToMock {
  
      fun myFunc(stringArg: String, booleanArg: Boolean = false, functionArg: (String) -&gt; Any = { 0 }): String
  
  }
  </code></pre>
  
  <p>I'd like to be able to stub <code>myFunc</code> but can't figure out how to. Something like</p>
  
  <pre><code>@Mock
  lateinit var mockedObject: ObjectToMock
  
  @Before
  fun setup() {
      MockitoAnnotations.initMocks(this)
      `when`(mockedObject.myFunc(anyString(), anyBoolean(), any())).thenReturn("")
  }
  </code></pre>
  
  <p>Using <code>any()</code> and <code>notNull()</code> both lead to <code>java.lang.IllegalStateException: any() must not be null</code></p>