Is there a way to return the received object in Mockito? I want to do this simulating the saving of the object in the database. Something like this:
someClass someObj = ...;
when(dataProviderMock.insert(someObj))
.then(
when(dataProviderMock.read(someObj.getId()))
.thenReturn(someObj)
);