title: How to set expectation to params passed to void methods using EasyMock
body: <p>I am using EasyMock and EasyMock CE 3.0 to mock dependent layers and test my classes. Below is the scenario for which I am not able to find any solution</p>
  
  <p>I have class to be tested, which calls a dependent class <strong>void method that takes an input param, and alters the same param</strong>. The method that I am testing is doing some operations based on the altered param, which I have to test now for various scenarios</p>
  
  <p>Consider the below sample, where I have tried to put the same scenario</p>
  
  <pre><code>public boolean voidCalling(){
      boolean status = false;
      SampleMainBean mainBean = new SampleMainBean();
      dependentMain.voidCalled(mainBean);
      if(mainBean.getName() != null){
          status = true; 
      }else{
          status = false;
      }
      return status;
  }
  </code></pre>
  
  <p>And the dependentMain class the below method</p>
  
  <pre><code>public void voidCalled(SampleMainBean mainBean){
      mainBean.setName("Sathiesh");
  }
  </code></pre>
  
  <p>To have full coverage, I need to have 2 test cases to test both the scenarios where true and false are returned, but I always get false as I am not able to set the behaviour of the void method to alter this input bean. How can I get a true as result in this scenario using EasyMock</p>
  
  <p>Thanks in advance for any help.</p>