title: stubbing methods that manipulates parameters with mockito
body: <p>I have the following situation:  </p>
  
  <pre class="lang-java prettyprint-override"><code>class Worker {  
    public Integer somework() {  
        Integer k=0;  
        Helper h= new Helper();  
        h.change(k);  
        return k;  
      }
  }
  
  class Helper {
    public void change(Integer k) {
      //k = Some calcs
    }
  }
  </code></pre>
  
  <p>I'm making unitests for <code>Worker</code> and obviously I want to mock <code>Helper</code> class so that his <code>change</code> method will always put 1 into <code>k</code>.  </p>
  
  <p>My real situation is more complicated but this code represents the issue. Thanks for help.</p>