title: Dynamic return values with Mockito
body: <p>One typically defines return values for a Mockito mock as follows:</p>
  
  <pre><code>MyClass myClass = Mockito.mock(MyClass.class);
  when(myClass.myMethod()).thenReturn(0, 100, 200, ...);
  </code></pre>
  
  <p>Is there a way to this dynamically by supplying a seed and a function, e.g.:</p>
  
  <pre><code>when(mock.myMethod()).thenReturn(seed, previousVal -&gt; previousVal + 100);
  </code></pre>