title: Parameter specified as non-null is null when using Mokito anyObject() on Kotlin function
body: <p>My code as below, refering to the solution in <a href="https://stackoverflow.com/a/30308199/3286489">https://stackoverflow.com/a/30308199/3286489</a></p>
  
  <pre><code>import org.mockito.Mock
  import org.mockito.Mockito
  import org.mockito.MockitoAnnotations
  import org.mockito.Mockito.*
  
  class SimpleClassTest {
  
      private fun &lt;T&gt; anyObject(): T {
          Mockito.anyObject&lt;T&gt;()
          return uninitialized()
      }
  
      private fun &lt;T&gt; uninitialized(): T = null as T
      lateinit var simpleObject: SimpleClass
      @Mock lateinit var injectedObject: InjectedClass
  
  
      @Before
      fun setUp() {
          MockitoAnnotations.initMocks(this)
      }
  
      @Test
      fun testSimpleFunction() {
          simpleObject = SimpleClass(injectedObject)
  
          verify(injectedObject).settingDependentObject(anyObject())
  
      }
  }
  </code></pre>
  
  <p>I still have the below error</p>
  
  <pre><code>java.lang.IllegalArgumentException: Parameter specified as non-null is null: method my.package.InjectedClass.settingDependentObject, parameter dependentObject
  </code></pre>
  
  <p>Did I miss anything?</p>
  
  <p><strong>UPDATED</strong>
  Below is the code tested (simplest form and working)</p>
  
  <pre><code>class SimpleClass(val injectedClass: InjectedClass) {
  
      fun simpleFunction() {
          injectedClass.settingDependentObject(DependentClass(Response.Builder().build()))
      }
  }
  
  open class DependentClass(response: Response) {
  
  }
  
  open class InjectedClass() {
      lateinit var dependentObject: DependentClass
  
      fun settingDependentObject(dependentObject: DependentClass) {
          this.dependentObject = dependentObject
      }
  }
  </code></pre>