title: PowerMockito: got InvalidUseOfMatchersException when use matchers mocking static method
body: <p>When I'm testing this static method</p>
  
  <pre><code>public class SomeClass {
      public static long someMethod(Map map, String string, Long l, Log log) {
          ...
      }
  }
  </code></pre>
  
  <p>with</p>
  
  <pre><code>import org.apache.commons.logging.Log;
  
  @RunWith(PowerMockRunner.class)
  //@PrepareForTest(SomeClass.class)
  public class Tests {
      @Test
      public void test() {
          ...
          PowerMockito.mockStatic(SomeClass.class);
          Mockito.when(SomeClass.someMethod(anyMap(), anyString(), anyLong(), isA(Log.class))).thenReturn(1L);
          ...
      }
  }
  </code></pre>
  
  <p>I got <code>InvalidUseOfMatchersException</code>. My questions are:</p>
  
  <ol>
  <li>Why I got this exception when all the arguments are using matchers? How to solve it? I have debugged it, found the <code>isA(Log.class)</code> returns null.</li>
  <li>When I add the <code>@PrepareForTest</code> annotation to the test class and run the test, the junit makes no  response. Why?</li>
  </ol>
  
  <p>EDIT</p>
  
  <p>I tried not to use argument matchers, and got </p>
  
  <blockquote>
    <p>org.mockito.exceptions.misusing.MissingMethodInvocationException: 
    when() requires an argument which has to be 'a method call on a mock'.
    For example:
        when(mock.getArticles()).thenReturn(articles);</p>
    
    <p>Also, this error might show up because:</p>
    
    <ol>
    <li><p>you stub either of: final/private/equals()/hashCode() methods.
    Those methods <em>cannot</em> be stubbed/verified.</p></li>
    <li><p>inside when() you don't call method on mock but on some other object.</p></li>
    </ol>
    
    <p>at ...</p>
  </blockquote>
  
  <p>So it seems due to the <code>someMethod</code> itself. There are <strong>synchronized</strong> block in the method. I'm wondering if Powermockito can mock that kind of method or not.</p>