title: How to solve the confusion when using Mockito.any()?
body: <p>I want to mock the result of a method that is called two times with different params.</p>
  
  <p>I used this code</p>
  
  <pre><code>Mockito.when(rt.exchange(Mockito.anyString(), Mockito.any(HttpMethod.class), Mockito.&lt;HttpEntity&lt;?&gt;&gt; any(), Mockito.&lt;Class&lt;String&gt;&gt; any())).thenReturn(response);
  
  Mockito.when(rt.exchange(Mockito.anyString(), Mockito.any(HttpMethod.class), Mockito.&lt;HttpEntity&lt;?&gt;&gt;any(), Matchers.&lt;Class&lt;InfsEspecificasDTO&gt;&gt; any())).thenReturn(responseInfoEsp);
  </code></pre>
  
  <p>Howevere, when I launch the test the first Mock is always the one executed.
  How to solve this confusion. I tried specifying the 4th param in the second Mock as <code>InfsEspecificasDTO.class</code> but I get </p>
  
  <blockquote>
    <p>InvalidUseOfMatchersException</p>
  </blockquote>
  
  <p>How can I solve the confusion?</p>