title: Junit test: static method invocation into testing method
body: <p>I have a code that will be tested:</p>
  
  <pre><code>public void ackAlert(final Long alertId, final String comment) {
      final AnyTask task = AnyTask.create(
              "ackAlert", new Class[] { Long.class, String.class },
              new Object[] { alertId, comment });
      taskExecutor.execute(task);
  }
  </code></pre>
  
  <p>I'm writting test to it:</p>
  
  <pre><code> public void testAckAlert() throws Exception {
  
    final Long alertId = 1L;
    final String comment = "tested";
  
    final AnyTask task = AnyTask.create(
      "ackAlert", new Class[] { Long.class, String.class },
      new Object[] { alertId, comment });
  
    taskExecutor.execute(task);
    expectLastCall();
  
    replay(taskExecutor);
  
    testingObjectInstance.ackAlert(alertId, comment);
  
    verify(taskExecutor);
  
   }
  </code></pre>
  
  <p>And I got exception:</p>
  
  <blockquote>
    <p>java.lang.AssertionError:    Unexpected method call
    execute(com.alert.bundle.model.AnyTask@4cbfea1d):
        execute(com.alert.bundle.model.AnyTask@65b4fad5): expected: 1,
    actual: 0</p>
  </blockquote>
  
  <p>Where is my error? I think problem is in invocation of static method <em>create</em>. </p>