title: What does "stub" means in testing?
body: <p>Can someone please explain me what "stub" means in testing context? For example what does it mean in the comments below? </p>
  
  <pre><code>@Before
      public void stubAllExternalIntents() {
          // By default Espresso Intents does not **stub** any Intents. Stubbing needs to be setup before
          // every test run. In this case all external Intents will be blocked.
          intending(not(isInternal())).respondWith(new ActivityResult(Activity.RESULT_OK, null));
      }
  </code></pre>
  
  <p>OR here:</p>
  
  <pre><code>@Test
      public void pickContactButton_click_SelectsPhoneNumber() {
          // **Stub** all Intents to ContactsActivity to return VALID_PHONE_NUMBER. Note that the Activity
          // is never launched and result is stubbed.
          intending(hasComponent(hasShortClassName(".ContactsActivity")))
                  .respondWith(new ActivityResult(Activity.RESULT_OK,
                          ContactsActivity.createResultData(VALID_PHONE_NUMBER)));
  </code></pre>