Let's imagine I have a following method in some service class:

```
public SomeEntity makeSthWithEntity(someArgs){
    SomeEntity entity = new SomeEntity();
    /**
     * here goes some logic concerning the entity
     */
    return repository.merge(entity);
}

```

I'd like to test the behaviour of this method and thus want to mock the `repository.merge` in following manner:

```
when(repository.merge(any(SomeEntity.class))).thenReturn(objectPassedAsArgument);

```

Then mocked repository returns that what `makesSthWithEntity` passed to it and I can easily test it.

Any ideas how can I force mockito to return **`objectPassedAsArgument`** ?