title: How do I verify a method call and ignore the return value in EasyMock?
body: <p>I'm getting frustrated trying to do a simple thing - I want to invoke a method on a mock object and NOT check its return value. I just want to check that it was invoked with the correct parameters.</p>
  
  <p>Example:</p>
  
  <pre><code>MyInterface mockObject = createMock(MyInterface.class);
  SomeObject param = new SomeObject();
  
  /* the write object is not void and returns an instance of FooOjbect.
   * I want to ignore everything to do with FooObject - I do not care what
   * it is because I do not store its value. How do I do this? */
  mockObject.write(param);
  
  replay(mockObject);
  
  someOtherObjectThatCallsAboveMockObject.process(mockObject);
  
  verify(mockObject);
  </code></pre>
  
  <p>So are there any EasyMock experts out there? I'm not concerned about the design of the underlying method that I'm calling and not storing the return value because the actually implementation is coming from a third-party networking library (Apache Mina) and I have no control over the API.</p>
  
  <p>EDIT:
  <em>Conclusion reached some time later</em></p>
  
  <p>I dumped EasyMock because it wasn't easy and went for <a href="http://www.mockito.org" rel="nofollow noreferrer">Mockito</a>.</p>