title: Mockito verify() fails with "too many actual invocations"
body: <p>I have a fairly involved test case I am trying to add the following verify() to:</p>
  
  <pre><code>verify(userService).getUserById(anyLong()).setPasswordChangeRequired(eq(Boolean.TRUE));
  </code></pre>
  
  <p>This fails with this error: </p>
  
  <pre><code>org.mockito.exceptions.verification.TooManyActualInvocations: 
  userService.getUserById(&lt;any&gt;);
  Wanted 1 time:
  -&gt; at     test.controllers.AuthenticationControllerMockTest.testLookupsExceeded(AuthenticationControllerMockTest.java:404)
  But was 4 times. Undesired invocation:
  </code></pre>
  
  <p>So I changed it to this:</p>
  
  <pre><code>verify(userService, atLeastOnce()).getUserById(anyLong()).setPasswordChangeRequired(eq(Boolean.TRUE));
  </code></pre>
  
  <p>And now it fails with: </p>
  
  <pre><code>java.lang.NullPointerException
      at test.controllers.AuthenticationControllerMockTest.testLookupsExceeded(AuthenticationControllerMockTest.java:404)
  </code></pre>
  
  <p>because this is returning null:</p>
  
  <pre><code>verify(userService, atLeastOnce()).getUserById(anyLong())
  </code></pre>
  
  <p>This seems puzzling - If I use the default (one invocation only), it fails because it's being invoked multiple times, but if I tell it that multiple invocations are OK, it fails because it can't find any invocations!</p>
  
  <p>Can anyone help with this?  </p>