title: How do I force Mockito to call underlaying functions with arguments?
body: <p>I have this:</p>
  <pre><code>class MyClass {
      private String foo;
      public getFoo() { return foo; }
      public setFoo(String foo) { this.foo = foo; }
  }
  </code></pre>
  <p>Now, I want to mock it.</p>
  <pre><code>MyClass m = Mockito.mock(MyClass.class);
  when(m.getFoo()).thenCallRealMethod();
  when(m.setFoo(Mockito.anyString())).thenCallRealMethod(); 
  </code></pre>
  <p>But this gives me this compile error:</p>
  <pre><code>'void' type not allowed here
  </code></pre>
  <p>Using <code>thenCallRealMethod()</code> seems to work for methods with no arguments, but I cannot get it to work with arguments. What am I doing wrong?</p>