title: ArgumentMatchers.any must not be null
body: <p>I am trying to test <code>ViewModel</code> to make sure livedata gets updated correctly. However when using <code>ArgumentMatchers.any()</code> it fails with <code>IllegalStateException</code> saying:</p>
  <blockquote>
  <p>ArgumentMatchers.any(mViewModel.CountSubscriber::class.java) must not
  be null</p>
  </blockquote>
  <pre><code>@Test
  fun emitValueIfCountIs7() {
      doAnswer { invocation: InvocationOnMock -&gt;
          val subscriber: mViewModel.CountSubscriber = invocation.getArgument(0)
          subscriber.onNext(7)
          null
      }.`when`(countUseCase).execute(
          ArgumentMatchers.any(mViewModel.CountSubscriber::class.java),
          ArgumentMatchers.any(Parameters::class.java)
      )
      
      // When
      mViewModel.getCount()
      
      // Verify
      assert(mViewModel.countResponse.value != null)
  }
  </code></pre>
  <p>I am using Kotlin and have the following dependencies:</p>
  <pre><code>testImplementation 'junit:junit:4.12'
  testImplementation &quot;org.mockito:mockito-inline:2.23.4&quot;
  testImplementation &quot;com.nhaarman.mockitokotlin2:mockito-kotlin:2.1.0&quot;
  </code></pre>
  <p>Here are my imports:</p>
  <pre><code>import androidx.arch.core.executor.testing.InstantTaskExecutorRule
  import com.nhaarman.mockitokotlin2.doAnswer
  import io.reactivex.Observable
  import org.junit.Before
  import org.junit.Rule
  import org.junit.Test
  import org.mockito.ArgumentMatchers.any
  import org.mockito.Mock
  import org.mockito.Mockito
  import org.mockito.MockitoAnnotations
  import org.mockito.invocation.InvocationOnMock
  </code></pre>
  <p>Strange thing is that it used to work before, and I don't know what has happened that could affect this.</p>