title: Mockito - when thenReturn
body: <p>I'm new to the Mockito library and I can't understand the following syntax:
  before the test I defined - </p>
  
  <pre><code>when(CLASS.FUNCTION(PARAMETERS)).thenReturn(RETURN_VALUE)
  </code></pre>
  
  <p>And the actual test is  - </p>
  
  <pre><code>assertSame(RETURN_VALUE, CLASS.FUNCTION(PARAMETERS))
  </code></pre>
  
  <p>Don't I just set the return value of the function with the first line of code (<code>when... thenReturn</code>) to be <code>RETURN_VALUE</code>? If the answer is yes, then of course <code>assertSame</code> will be true and the test will pass, what am I missing here? </p>