title: Optional parameters in cucumber throw error
body: <p>I think I am copying the answer from <a href="https://stackoverflow.com/questions/18346348/optional-parameter-in-cucumber">here</a>, but I still cannot get optional parameters to work.  The two steps run independently, I just wanted to try and combine them.</p>
  
  <p>Scenario:</p>
  
  <blockquote>
    <p>Then(~/^set timeout(?: at (\d+) (min|hr))?$/) { int duration , String units -></p>
  </blockquote>
  
  <p>Works for           </p>
  
  <blockquote>
    <p>And set timeout at 30 min</p>
  </blockquote>
  
  <p>But not for:</p>
  
  <blockquote>
    <p>And set timeout</p>
  </blockquote>
  
  <p>Which throws this error</p>
  
  <blockquote>
    <p>groovy.lang.MissingMethodException: No signature of method: CucumberTestSteps$_run_closure56.doCall() is applicable for argument types: (null, null) values: [null, null]
          Possible solutions: doCall(int, java.lang.String), findAll(), findAll()</p>
  </blockquote>
  
  <p>I've tried several other random locations for '?:' and '?' with no luck.  Also several web searches which all come back to that syntax should work.</p>
  
  <p>Cucumber recognizes it as a valid test because when I add</p>
  
  <blockquote>
    <p>Then(~/^set timeout$/) </p>
  </blockquote>
  
  <p>It recognises it as a duplicate step</p>
  
  <blockquote>
    <p>cucumber.runtime.AmbiguousStepDefinitionsException: ✽.Then set timeout(test.feature:57) matches more than one step definition:
      ^set timeout$ in CucumberTestSteps.groovy:1128
      ^set timeout(?: at (\d+) (min|hr))?$ in CucumberTestSteps.groovy:1148 </p>
  </blockquote>