title: Getting PowerMockito to mock a static method on an Interface?
body: <p>I have a library I am trying to mock for testing... There is a Java 8 interface with a static method implementation like this:</p>
  
  <pre><code>public interface Router {
      public static Router router(Object param) {
          return new RouterImpl(param);
      }
  }
  </code></pre>
  
  <p>And I am trying to mock that returned value:</p>
  
  <pre><code>PowerMockito.mockStatic(Router.class);
  PowerMockito.doReturn(mockRouter).when(Router.router(any()));
  </code></pre>
  
  <p>But when I run the tests through a debugger, the mock instance is not returned.</p>
  
  <p>I've tried a number of different permutations of the static mocking, but I cannot get the static method to return my mock value. Any thoughts?</p>