title: EasyMock expectations within loop
body: <p>Is it possible to set different expectations for a mock which is being invoked in a loop?</p>
  
  <p>Considering the use case,</p>
  
  <pre><code>while(condition){
     List list = Database call //Call to be mocked
     ....
     Logic based on above response
  }
  </code></pre>
  
  <p>how can we set expectations such the first iteration returns a list of objects, while the second call returns empty list?</p>