title: ArgumentCaptor with @Captor annotation in Kotlin
body: <p>I'm using an <a href="https://static.javadoc.io/org.mockito/mockito-core/2.24.5/org/mockito/ArgumentCaptor.html" rel="nofollow noreferrer">ArgumentCaptor</a> with <a href="https://static.javadoc.io/org.mockito/mockito-core/2.24.5/org/mockito/Captor.html" rel="nofollow noreferrer">@Captor</a> annotation in Kotlin like this</p>
  
  <pre><code>@Captor private lateinit var captor: ArgumentCaptor&lt;MyObject&gt;
  @Mock private lateinit var mockObject: InnerObject
  private lateinit var objectToTest: MyClass
  
  @Before
  fun setUp() {
      MockitoAnnotations.initMocks(this)
  
      objectToTest = MyClass(mockObject)
  }
  
  fun testSomething() {
      objectToTest.doSomething()
  
      verify(mockObject).callMethod(captor.capture())
      assertThat(expectedResult, captor.value)
  
  }
  </code></pre>
  
  <p>The method callMethod() is called inside doSomething() and I want to capture the parameter sent to it. </p>
  
  <p>My problem is that I'm getting: </p>
  
  <pre><code>java.lang.IllegalStateException: captor.capture() must not be null
  </code></pre>
  
  <p>I tried the same approach using java and it's working, when I convert it to Kotlin I get the exception. </p>
  
  <p>Is this related to Kotlin? Or am I not using @Captor the right way? </p>