title: How to test in Mockito for specific order of calls with same arguments?
body: <p>I want to verify the specific order in which characters to ensure that they aren't getting garbled. I tried writing it using <code>InOrder</code> but it seems not to work, or at least in Mockito 1.8.5. </p>
  
  <pre><code>@Test
  public void inOrderTest() throws IOException{
      final String message = "Hello World!\n";
  
      for( char c : message.toCharArray() )
          mockWriter.write( c );
  
      final InOrder inOrder = inOrder( mockWriter );
      for( char c : message.toCharArray() )
          inOrder.verify( mockWriter ).write( c );
      inOrder.verifyNoMoreInteractions();
  }
  </code></pre>
  
  <p>The test above fails with the message: </p>
  
  <pre><code>Verification in order failure:
  mockWriter.write(108);
  Wanted 1 time:
  -&gt; at     org.bitbucket.artbugorski.brainfuj.interpreter.InterpreterTest.inOrderTest(InterpreterTest.java:62)
  But was 3 times. Undesired invocation:
  -&gt; at org.bitbucket.artbugorski.brainfuj.interpreter.InterpreterTest.inOrderTest(InterpreterTest.java:58)
  </code></pre>
  
  <p>How does one write a Mockito test for that?</p>
  
  <hr>
  
  <p><strong>EDIT:</strong> Filed as bug <a href="http://code.google.com/p/mockito/issues/detail?id=296" rel="noreferrer">http://code.google.com/p/mockito/issues/detail?id=296</a></p>