title: Mocked private method is called instead of being mocked
body: <p>I'm using PowerMockito for mocking private method. But instead being mocked it is called. I need to test strangeMethod(), which calls privateMethod().</p>
  
  <p>Here is my class for testing:</p>
  
  <pre><code>public class ExampleService {
      public String strangeMethod() {
          privateMethod();
          return "Done!";
      }
  
      private String privateMethod() {
          throw new UnsupportedOperationException();
      }
  }
  </code></pre>
  
  <p>My test method:</p>
  
  <pre><code>@Test
  public void strangeMethodTest() throws Exception {
      ExampleService exampleService = PowerMockito.spy(new ExampleService());
      PowerMockito.when(exampleService, "privateMethod").thenReturn("");
      exampleService.strangeMethod();
  }
  </code></pre>
  
  <p>As a result of the test I'm getting UnsupportedOperationException. This means, that privateMethod() is called.</p>