title: assertion error on passing EasyMock.anyObject()
body: <p>I have two method call back to back based upon some processing. Both are returning some event when I try to pass <code>EasyMock.anyObject()</code>. When executing the test case <code>null</code> value is coming inside the method parameter. I am new to EasyMock. Can someone please see what mistake I am doing?</p>
  
  <p>Error:</p>
  
  <pre><code>java.lang.AssertionError: 
    Unexpected method call usrAuthenticationViaFormAction.submit(null, null, null):
      usrAuthenticationViaFormAction.setCredentialsToFlowScope(): expected: 1, actual: 0
      at org.easymock.internal.MockInvocationHandler.invoke(MockInvocationHandler.java:44)
      at org.easymock.internal.ObjectMethodsFilter.invoke(ObjectMethodsFilter.java:85)
      at org.easymock.internal.ClassProxyFactory$MockMethodInterceptor.intercept(ClassProxyFactory.java:94)
      at com.shc.ecom.usr.web.action.USRAuthenticationViaFormAction$$EnhancerByCGLIB$$d3989200.submit(&lt;generated&gt;)
      at com.shc.ecom.test.usr.TestloginlFlow.testWhenServiceIsNotNullSubmitAuthenticationFailure(TestloginlFlow.java:438)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:483)
      at junit.framework.TestCase.runTest(TestCase.java:154)
      at junit.framework.TestCase.runBare(TestCase.java:127)
      at junit.framework.TestResult$1.protect(TestResult.java:106)
      at junit.framework.TestResult.runProtected(TestResult.java:124)
      at junit.framework.TestResult.run(TestResult.java:109)
      at junit.framework.TestCase.run(TestCase.java:118)
      at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:131)
      at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
  </code></pre>
  
  <p>Method:</p>
  
  <pre class="lang-java prettyprint-override"><code>class UsrAuthenticationViaFormAction {
  
      public  Event submit( RequestContext context,  Credential credential, MessageContext messageContext) {
  
          //          if (!checkLoginTicketIfExists(context)) {
          //              return returnInvalidLoginTicketEvent(context, messageContext);
          //          }
  
          if (isRequestAskingForServiceTicket(context)) {
              return grantServiceTicket(context, credential);
          }
  
          return createTicketGrantingTicket(context, credential, messageContext);
      }
  }
  </code></pre>
  
  <p>Test case:</p>
  
  <pre class="lang-java prettyprint-override"><code>public void test(){
      usrAuthenticationViaFormAction = EasyMock.createMock("usrAuthenticationViaFormAction", USRAuthenticationViaFormAction.class);
  
      Event event = new Event(this, "success");
      try {
          EasyMock.expect(usrAuthenticationViaFormAction.isRequestAskingForServiceTicket((EasyMock.anyObject())))
                          .andReturn(false).anyTimes();
          EasyMock.expect(usrAuthenticationViaFormAction.createTicketGrantingTicket((EasyMock.anyObject()),
                          EasyMock.anyObject(), EasyMock.anyObject())).andReturn(event).anyTimes();
          EasyMock.expect(usrInitialFlowSetupAction.doExecute(EasyMock.anyObject())).andReturn(event);
          EasyMock.replay(usrInitialFlowSetupAction);
          EasyMock.expect(usrAuthenticationViaFormAction.setCredentialsToFlowScope()).andReturn(false);
          EasyMock.replay(usrAuthenticationViaFormAction);
          EasyMock.expect(usrAuthenticationViaFormAction.submit(EasyMock.anyObject(), EasyMock.anyObject(), EasyMock.anyObject())).andReturn(new Event(this, "authenticationFailure")).anyTimes();
          EasyMock.replay(usrAuthenticationViaFormAction);
      }
  </code></pre>