title: How to verify multiple method calls with different params
body: <p>I have the following method that I wish to verify behaviour on.</p>
  <pre><code>public void methodToTest(Exception e, ActionErrors errors) {
      ...
  
      errors.add(&quot;exception.message&quot;, 
              ActionMessageFactory.createErrorMessage(e.toString()));
  
      errors.add(&quot;exception.detail&quot;,
              ActionMessageFactory.createErrorMessage(e.getStackTrace()[0].toString()));
  
      ...
  }
  </code></pre>
  <p>In my @Test class I was hoping to do something like this to verify that <code>errors.add()</code> is called with &quot;exception.message&quot; and again with &quot;exception.detail&quot;</p>
  <pre><code>verify(errors).add(eq(&quot;exception.message&quot;), any(ActionError.class));
  verify(errors).add(eq(&quot;exception.detail&quot;), any(ActionError.class));
  </code></pre>
  <p>however Mockito complains as follows</p>
  <pre><code>Argument(s) are different! Wanted:
  actionErrors.add(
      &quot;exception.message&quot;,
      &lt;any&gt;
  );
  
  Actual invocation has different arguments:
  actionErrors.add(
      &quot;exception.detail&quot;,
      org.apache.struts.action.ActionError@38063806
  );
  </code></pre>
  <p>How can I tell Mockito to check for both values?</p>