title: Mock static method call in default method in java 8 interface
body: <p>I have an interface like </p>
  
  <pre><code>public interface WithMD5Calculator{
  
      default String getMd5(){
          try{
              MessageDigest md = MessageDigest.getInstance("MD5");
              //... not important
          }catch(NoSuchAlgorithmException e){
             //... do some extra stuff and throw wrapped in ServiceException
          }
      }
  
      // rest of code not important
  }
  </code></pre>
  
  <p>And test that should verify exception handling:</p>
  
  <pre><code>@RunWith(PowerMockRunner.class)
  @PrepareForTest(MessageDigest.class)
  public class WithMD5Calculator{
  
      @Test
      public void shouldHandleNSAEx(){
          PowerMockito.mockStatic(MessageDigest.class);
          Mockito.when(MessageDigest.getInstance("MD5")).thenThrow(new NoSuchAlgorithmException("Throwed"));
  
          WithMD5Calculator sut = new WithMD5Calculator(){};
          ExceptionAssert.assertThat(()-&gt; sut.getMd5())
             .shouldThrow(ServiceException.class);
          // some more checks
      }
  }
  </code></pre>
  
  <p>But <code>ServiceException</code> were not throwed. Looks like <code>MessageDigest.getInstance</code> were not mocked.</p>
  
  <p>Any idea?</p>