title: Mockito throws NullPointer when creating a mock object
body: <p>I have an integration test in which some set up is done using Guice. I'm using Mockito to mock some of the dependencies. This has worked fine for me until now. I needed to use PowerMock for some other dependency. Now Mockito is throwing a <code>NullPointerException</code> while loading one of its own classes:</p>
  
  <pre><code>java.lang.ExceptionInInitializerError
      at org.mockito.internal.exceptions.stacktrace.ConditionalStackTraceFilter.&lt;init&gt;(ConditionalStackTraceFilter.java:17)
      at org.mockito.exceptions.base.MockitoException.filterStackTrace(MockitoException.java:30)
      at org.mockito.exceptions.base.MockitoException.&lt;init&gt;(MockitoException.java:19)
      at org.mockito.exceptions.misusing.MockitoConfigurationException.&lt;init&gt;(MockitoConfigurationException.java:18)
      at org.mockito.internal.configuration.ClassPathLoader.loadImplementations(ClassPathLoader.java:145)
      at org.mockito.internal.configuration.ClassPathLoader.findPluginImplementation(ClassPathLoader.java:110)
      at org.mockito.internal.configuration.ClassPathLoader.findPlatformMockMaker(ClassPathLoader.java:106)
      at org.mockito.internal.configuration.ClassPathLoader.&lt;clinit&gt;(ClassPathLoader.java:59)
      at org.mockito.internal.util.MockUtil.&lt;clinit&gt;(MockUtil.java:21)
      at org.mockito.internal.MockitoCore.&lt;init&gt;(MockitoCore.java:40)
      at org.mockito.Mockito.&lt;clinit&gt;(Mockito.java:932)
      &lt;snip my test code and some Guice&gt;
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:601)
      at org.junit.internal.runners.ClassRoadie.runBefores(ClassRoadie.java:56)
      at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:43)
      at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl.run(PowerMockJUnit44RunnerDelegateImpl.java:120)
      at org.powermock.modules.junit4.common.internal.impl.JUnit4TestSuiteChunkerImpl.run(JUnit4TestSuiteChunkerImpl.java:101)
      at org.powermock.modules.junit4.common.internal.impl.AbstractCommonPowerMockRunner.run(AbstractCommonPowerMockRunner.java:53)
      at org.powermock.modules.junit4.PowerMockRunner.run(PowerMockRunner.java:53)
      at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
      at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
  
  Caused by: java.lang.NullPointerException
      at org.mockito.internal.exceptions.stacktrace.StackTraceFilter.&lt;clinit&gt;(StackTraceFilter.java:21)
      ... 39 more
  </code></pre>
  
  <p>the (trimmed down) code:</p>
  
  <pre><code>@PrepareForTest(MyModule.class)
  @RunWith(PowerMockRunner.class)
  public class MyTest {
      @BeforeClass
      public static void setUp() {
          Injector injector = Guice.createInjector(...);
          MyModule module = PowerMockito.mock(MyModule.class);
          injector = injector.createChildInjector(...); // Fails in another Mockito.mock() call before it gets to use the mocked Module.
      }
  }
  </code></pre>
  
  <p>I couldn't find anything about this being a known bug in Mockito. Does anyone have a suggestion on how to solve this?</p>