title: EasyMock returns Null for Expected Method
body: <p>I have am having a problem with EasyMock returning null for an expected (defined) method call.</p>
  
  <p>Creation of the mocked Object</p>
  
  <pre><code>mock = EasyMock.createMock(DAO.class);
  </code></pre>
  
  <p>Mock Set up in unit test.</p>
  
  <pre><code>expect(mock.update(myObj).andReturn(myObjUpdated).once();
  replayAll();
  service.setDao(mock);
  service.processData(myObj);
  verifyAll();
  </code></pre>
  
  <p>processData method simply calls </p>
  
  <pre><code>MyObject objUpdated = dao.update(myObj);
  </code></pre>
  
  <p>here is the interface that the mock is being built from.</p>
  
  <pre><code>public interface DAO {
     public &lt;ENTITY&gt; ENTITY update(ENTITY entity);
  }
  </code></pre>
  
  <p>I am pretty confused by what might be causing the problem.  I have confirmed that 'obj' is the same object as I defined in the unit test.  I have also not experienced this problem (that I am aware of) with any other methods that mocked.</p>
  
  <p>Could the problem possibly be with the Object that is being passed in?</p>
  
  <p>Thanks in advance.  I am really not sure what other information might be helpful to you here.</p>
  
  <p>edit: this is the test class (and as it turns out where my misunderstanding began)</p>
  
  <pre><code>public class TestMyService extends EasyMockHelper {...}
  </code></pre>