title: Spock: Return input parameter in Stubs
body: <p>Given an method with a parameter <em>in Java</em>, e.g.</p>
  
  <pre><code>public class Foo {
     public Bar theBar(Bar bar) { /*... */ }   
  }
  </code></pre>
  
  <p>When stubbing/ mocking foo, how do I tell it to accept any argument and return it? (<em>Groovy</em>)</p>
  
  <pre><code>def fooStub = Stub(Foo) {
    theBar(/*what to pass here*/) &gt;&gt; { x -&gt; x }
  }
  </code></pre>
  
  <p>As you can see I passed the identity function. However I do not know what to pass as argument. <code>_</code> does not work because it is an <code>ArrayList</code> and thus not of type <code>Bar</code></p>