title: Powermock + Mockito not working
body: <p>Trying to use Powermock to mock out a static method on SystemTray. Not sure why this isn't working. I've checked the match of Powermock -> Mockito versions, and I think I've followed all the steps for adding the right annotations, and using the correct PowerMock methods to setup the static one.</p>
  
  <p>The static method on SystemTray seems to be called without the stubbed functionality set by the when().</p>
  
  <p>I am mixing Powermock and Mockito calls here, but according to the docs that is correct. </p>
  
  <pre><code>package CommissionChecker;
  
  import org.apache.commons.logging.Log;
  import org.junit.Test;
  import org.junit.runner.RunWith;
  import org.mockito.Mock;
  import org.mockito.Mockito;
  import org.mockito.runners.MockitoJUnitRunner;
  import org.powermock.core.classloader.annotations.PrepareForTest;
  import org.powermock.modules.junit4.PowerMockRunner;
  import org.springframework.test.util.ReflectionTestUtils;
  
  import java.awt.*;
  import java.io.IOException;
  import java.util.List;
  
  import static org.mockito.Mockito.*;
  import static org.powermock.api.mockito.PowerMockito.mockStatic;
  
  @RunWith(PowerMockRunner.class)
  @PrepareForTest(SystemTray.class)
  public class DisplayManagerTest {
  
      @Mock
      Log logMock;
      @Mock
      Runner runnerMock;
  
      @Test
      public void display_manager_does_nothing_if_system_tray_is_not_supported() throws IOException, AWTException {
          mockStatic(SystemTray.class);
          when(SystemTray.isSupported()).thenReturn(false);
  
          new DisplayManager(runnerMock);
  
          verifyZeroInteractions(runnerMock);
      }
  }
  </code></pre>
  
  <p>These are my maven dependencies</p>
  
  <pre><code>    &lt;powermock.version&gt;1.5.2&lt;/powermock.version&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.mockito&lt;/groupId&gt;
          &lt;artifactId&gt;mockito-all&lt;/artifactId&gt;
          &lt;version&gt;1.9.5&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.powermock&lt;/groupId&gt;
          &lt;artifactId&gt;powermock-module-junit4&lt;/artifactId&gt;
          &lt;version&gt;${powermock.version}&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.powermock&lt;/groupId&gt;
          &lt;artifactId&gt;powermock-api-mockito&lt;/artifactId&gt;
          &lt;version&gt;${powermock.version}&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  </code></pre>