title: NullPointerException in Mockito when mocking method with primitive argument
body: <p>I've spent the last little while pulling out my hair trying to find the problem in my test, and eventually figured out it has to do with mocking a method that takes primitive arguments.  Here's a sample test that demos the problem:</p>
  
  <pre><code>import static org.mockito.Matchers.any;
  import static org.mockito.Mockito.mock;
  import static org.mockito.Mockito.times;
  import static org.mockito.Mockito.verify;
  
  import org.junit.Test;
  
  public class MockitoTest {
      public static interface Foo {
          public Object causeProblems(long arg);
      }
  
      @Test
      public void testFoo() {
          Foo foo = mock(Foo.class);
          foo.causeProblems(123);
          verify(foo, times(1)).causeProblems(any());
      }
  }
  </code></pre>
  
  <p>When running this test (I'm using Mockito 1.10 and Java8), and for some reason my stack trace is showing an NPE on the <code>verify</code> line:</p>
  
  <pre><code>java.lang.NullPointerException
      at com.amazon.jetstream.executor.worker.invoke.MockitoTest.testFoo(MockitoTest.java:19)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  ....
  </code></pre>
  
  <p>I think part of my stack trace is being suppressed (?) Digging into it a bit further, I can get slightly more info out of it if I run it in Eclipse and "inspect" the line, which tells me simply: </p>
  
  <pre><code>java.lang.NullPointerException at longValue()
  </code></pre>
  
  <p>Questions: </p>
  
  <ol>
  <li>Does anyone know how to workaround this bug? </li>
  <li>If you can reproduce this, can you get more info out of your stack trace?</li>
  </ol>