title: Mockito - returning the same object as passed into method
body: <p>Let's imagine I have a following method in some service class:</p>
  
  <pre><code>public SomeEntity makeSthWithEntity(someArgs){
      SomeEntity entity = new SomeEntity();
      /**
       * here goes some logic concerning the entity
       */
      return repository.merge(entity);
  }
  </code></pre>
  
  <p>I'd like to test the behaviour of this method and thus want to mock the <code>repository.merge</code> in following manner:</p>
  
  <pre><code>when(repository.merge(any(SomeEntity.class))).thenReturn(objectPassedAsArgument);
  </code></pre>
  
  <p>Then mocked repository returns that what <code>makesSthWithEntity</code> passed to it and I can easily test it.</p>
  
  <p>Any ideas how can I force mockito to return <strong><code>objectPassedAsArgument</code></strong> ?</p>