title: Matching an array of Objects using Mockito
body: <p>I'm trying to set up a mock for a method that takes an array of Request objects:</p>
  
  <pre><code>client.batchCall(Request[])
  </code></pre>
  
  <p>I've tried these two variations:</p>
  
  <pre><code>when(clientMock.batchCall(any(Request[].class))).thenReturn(result);
  ...
  verify(clientMock).batchCall(any(Request[].class));
  </code></pre>
  
  <p>and</p>
  
  <pre><code>when(clientMock.batchCall((Request[])anyObject())).thenReturn(result);
  ...
  verify(clientMock).batchCall((Request[])anyObject());
  </code></pre>
  
  <p>But I can tell the mocks aren't being invoked.</p>
  
  <p>They both result in the following error:</p>
  
  <pre><code>Argument(s) are different! Wanted:
  clientMock.batchCall(
      &lt;any&gt;
  );
  -&gt; at com.my.pkg.MyUnitTest.call_test(MyUnitTest.java:95)
  Actual invocation has different arguments:
  clientMock.batchCall(
      {Request id:123},
      {Request id:456}
  );
  </code></pre>
  
  <p>Why does the  matcher not match the array? Is there a special matcher I need to use to match an array of objects? The closest thing I can find is AdditionalMatches.aryEq(), but that requires that I specify the exact contents of the array, which I'd rather not do.</p>