title: mocking UrlEncoder in a static method
body: <p>I'm having trouble mocking UrlEncode.encode method which is inside a static method.</p>
  
  <p>MyEncodeClass.java has this method</p>
  
  <pre><code>public static myEncode(String s) {
    UrlEncoder.encode(s, "utf-8");
  }
  </code></pre>
  
  <p>I want to force throw an exception when UrlEncode.encode method is called.</p>
  
  <pre><code>@Test(expect = UnsupportedEncodingException.class)
  public void myTest() {
      PowerMockito.mockStatic(URLEncoder.class);        
      when(URLEncoder.encode("aa", "utf-8")).thenThrow(UnsupportedEncodingException.class);    
      MyEncodeClass.myEncode("aa");
  }
  </code></pre>
  
  <p>but I always get the following exception</p>
  
  <pre><code>Caused by: java.lang.NoSuchMethodError: org.mockito.mock.MockCreationSettings.isUsingConstructor()Z
  </code></pre>