title: Mocktito ArgumentCaptor for Kotlin lambda with arguments
body: <p>I am trying to test this on Kotlin:</p>
  
  <pre><code>verify(myInterface).doSomething(argumentCaptor.capture())
  capture.value.invoke(0L)
  </code></pre>
  
  <p>Where doSomething is:</p>
  
  <pre><code>doSomething((Long) -&gt; Unit)
  </code></pre>
  
  <p>How can I create an ArgumentCaptor for this? Right now I am doing this</p>
  
  <pre><code>inline fun &lt;reified T : Any&gt; argumentCaptor() = ArgumentCaptor.forClass(T::class.java)!!
      val captor = argumentCaptor&lt;(Long) -&gt; Unit&gt;()
  
      verify(mainApiInterface!!).downloadUserProfilePicture(captor.capture())
      captor.value.invoke(0L)
  </code></pre>
  
  <p>But I am getting java.lang.IllegalStateException: captor.capture() must not be null</p>
  
  <p>I also tried integrating mockito-kotlin but I get a PowerMockito error:</p>
  
  <blockquote>
    <p>No instance field named "reported" could be found in the class hierarchy of org.mockito.internal.MockitoCore.</p>
  </blockquote>