title: Android Espresso Testing: ActivityTestRule does not close the activity
body: <p>I am new to android testing. The test is very simple for now:</p>
  
  <pre><code>@RunWith(AndroidJUnit4.class)
  @SmallTest
  public class BaseTestCases {
      @Rule
      public ActivityTestRule&lt;MainActivity&gt; mActivityRule = new ActivityTestRule&lt;&gt;(MainActivity.class);
  
      @Test
      public void openBBCamera() throws InterruptedException {
      }
  }
  </code></pre>
  
  <p>I expected that the activity would be opened at the beginning and closed at the end of the test but it stays in the recent apps list so next test just opens the same activity. Is it the desired behavior or something is wrong with my environment or code?</p>