title: scalamock stubbing method with specific parameters fails on null
body: <p>Hi I want to stub a method with specific parameters and to get the result with a helper method</p>
  
  <pre><code>val myDAOMock = stub[MyDao]
  
    (myDAOMock.getFoos(_:String)).when("a").returns(resHelper("a"))
  //btw-is there a way to treat "a" as a parameter to the stubbed method and to the return ?
    (myDAOMock.getFoos(_:String)).when("b").returns(resHelper("b"))
  
  def resHelpr(x:String) = x match{
  case "a" =&gt; Foo("a")
  case "b" =&gt; Foo("b")
  }
  </code></pre>
  
  <p>but it seems that on my test I can capture only one since the 2nd test fails (regardless to the order that I run the tests )</p>
  
  <pre><code>"A stub test" must{
  "return Foo(a)" in{
  myDAOMock.getFoos("a")
  }
  "return Foo(b)" in{
  myDAOMock.getFoos("b") //this one will fail on null pointer exception 
  }
  </code></pre>
  
  <p>how can I improve my stubbing ?</p>