title: How to use ArgumentCaptor for stubbing?
body: <p>In Mockito <a href="https://static.javadoc.io/org.mockito/mockito-core/2.2.22/org/mockito/Mockito.html#21" rel="noreferrer">documentation</a> and <a href="https://static.javadoc.io/org.mockito/mockito-core/2.2.22/org/mockito/ArgumentCaptor.html" rel="noreferrer">javadocs</a> it says </p>
  
  <blockquote>
    <p>It is recommended to use ArgumentCaptor with verification but not with stubbing.</p>
  </blockquote>
  
  <p>but I don't understand how ArgumentCaptor can be used for stubbing. Can someone explain the above statement and show how ArgumentCaptor can be used for stubbing or provide a link that shows how it can be done?</p>