title: Android:Espresso: Can't check is success start activity
body: <p>Android Studio 3.2</p>
  
  <p>I have 2 activities.
  One activity (<code>TradersActivity</code>)  has list. Every item hast button "<strong>Json View</strong>". when click this button (on item with position <strong>15</strong>) then open another activity <code>JsonViewActivity</code>. I want to create Espresso's test that check that when I click this button then success open new activity <code>JsonViewActivity</code></p>
  
  <p>Here Espresso's test:</p>
  
  <pre><code>import org.hamcrest.CoreMatchers.not
  import java.util.*
  import org.junit.Rule
  import org.junit.Test
  import org.junit.runner.RunWith
  import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
  import android.graphics.Typeface
  import android.view.View
  import androidx.test.espresso.action.ViewActions.swipeLeft
  import androidx.test.espresso.intent.Intents.intended
  import androidx.test.espresso.intent.matcher.IntentMatchers.hasComponent
  import androidx.test.rule.ActivityTestRule
  
  @RunWith(AndroidJUnit4::class)
  class TradersActivityTest {
      @Rule
      @JvmField
      var tradersActivitytRule = ActivityTestRule(TradersActivity::class.java)
  
      @Test
      fun itemList_viewJsonButton_click_check() {
          //scroll
          onView(withId(R.id.tradersRecyclerView))
                  .perform(RecyclerViewActions.scrollToPosition&lt;RecyclerView.ViewHolder&gt;(15));
          // click
          onView(withRecyclerView(R.id.tradersRecyclerView).atPositionOnView(15, R.id.viewJsonButton))
                  .perform(click())
          // chekk ist start JsonViewActivity activity
          intended(hasComponent(JsonViewActivity::class.java.getName()))
      }
  </code></pre>
  
  <p>But I get error:</p>
  
  <pre><code>$ adb shell am instrument -w -r   -e debug false -e class 'com.myproject.android.activity.TradersActivityTest#itemList_viewJsonButton_click_check' com.myproject.android.debug.test/androidx.test.runner.AndroidJUnitRunner
  Client not ready yet..
  Started running tests
  
  java.lang.NullPointerException: Attempt to invoke virtual method 'void androidx.test.espresso.intent.Intents.internalIntended(org.hamcrest.Matcher, androidx.test.espresso.intent.VerificationMode, java.util.List)' on a null object reference
  at androidx.test.espresso.intent.Intents$2.check(Intents.java:194)
  at androidx.test.espresso.ViewInteraction$SingleExecutionViewAssertion.check(ViewInteraction.java:419)
  at androidx.test.espresso.ViewInteraction$2.call(ViewInteraction.java:282)
  at androidx.test.espresso.ViewInteraction$2.call(ViewInteraction.java:268)
  at java.util.concurrent.FutureTask.run(FutureTask.java:237)
  at android.os.Handler.handleCallback(Handler.java:739)
  at android.os.Handler.dispatchMessage(Handler.java:95)
  at android.os.Looper.loop(Looper.java:148)
  at android.app.ActivityThread.main(ActivityThread.java:5417)
  at java.lang.reflect.Method.invoke(Native Method)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
  
  Tests ran to completion.
  </code></pre>