title: Mockito: How do I verify that the array passed to my method contains the right object?
body: <p>I’m using Mockito 1.9.5.  I want to verify that my method (which takes an array as a param) was called in which the array contains exactly one specific object.  I’m having trouble figuring out how to do this.  I have</p>
  
  <pre><code>Mockito.doReturn(new SaveResult[]{}).when(mockConnection).update(org.mockito.Matchers.any(SObject[].class));
  …     
  
  Mockito.verify(mockConnection, Mockito.times(1)).update( new Account[]{ acct });
  </code></pre>
  
  <p>Unsurprisingly, the second line fails because although the argument, “acct” is the same as what is passed, the enclosing array is not.  What is the best way to check for this?</p>