title: Test param value using EasyMock
body: <p>I'm attempting to write some unit tests using EasyMock and TestNG and have run into a question.  Given the following:</p>
  
  <pre><code>void execute(Foo f) {
    Bar b = new Bar()
    b.setId(123);
    f.setBar(b);
  }
  </code></pre>
  
  <p>I'm trying to test that the Id of the Bar gets set accordingly in the following fashion:</p>
  
  <pre><code>@Test
  void test_execute() {
    Foo f = EasyMock.createMock(Foo.class);
  
    execute(f);
  
    Bar b = ?; // not sure what to do here
    f.setBar(b);
    f.expectLastCall();
  }
  </code></pre>
  
  <p>In my test, I can't just call <code>f.getBar()</code> and inspect it's Id because <code>f</code> is a mock object.  Any thoughts?  Is this where I'd want to look at the EasyMock v2.5 additions <code>andDelegateTo()</code> and <code>andStubDelegateTo()</code>?</p>
  
  <p>Oh, and just for the record... EasyMock's documentation blows.</p>