title: Is there a way of having something like jUnit Assert message argument in Mockito's verify method?
body: <p>Let's assume a snippet of testing code:</p>
  
  <pre><code>Observable model = Class.forName(fullyQualifiedMethodName).newInstance();
  Observer view = Mockito.mock(Observer.class);
  model.addObserver(view);
  for (Method method : Class.forName(fullyQualifiedMethodName).getDeclaredMethods())
  {
    method.invoke(model, composeParams(method));
    model.notifyObservers();
    Mockito.verify(
      view, Mockito.atLeastOnce()
    ).update(Mockito.&lt;Observable&gt;any(), Mockito.&lt;Object&gt;any());
  }
  </code></pre>
  
  <p><code>Mockito.verify</code> method throws an exception if a method in a model hasn't invoked <code>Observable.setChanged()</code> method.</p>
  
  <p>Problem: without adding <code>loggers/System.print.out</code> I can't realize what's the current method that has failed the test. Is there a way of having something similar to <code>jUnit Assert</code> methods:</p>
  
  <pre><code>Assert.assertEquals(
    String.format("instances %s, %s should be equal", inst1, inst2),
    inst1.getParam(), 
    inst2.getParam()
  );
  </code></pre>
  
  <hr>
  
  <p><strong>SOLUTION:</strong></p>
  
  <pre><code>verify(observer, new VerificationMode()
  {
    @Override
    public void verify(VerificationData data)
    {
      assertTrue(
          format(
              "method %s doesn't call Observable#setChanged() after changing the state of the model",
              method.toString()
          ),
          data.getAllInvocations().size() &gt; 0);
    }
  }).update(Mockito.&lt;Observable&gt;any(), Mockito.&lt;Object&gt;any());
  </code></pre>