ObjectIdUpdater objectIdUpdater = mock(ObjectIdUpdater.class);
@Test
public void shouldPreventLazyDBObjectToBeDeserialized() throws Exception {
Friend friend = new Friend(ObjectId.get(), "John");
ObjectId deserializedOid = ObjectId.get();
when(objectIdUpdater.getId(friend)).thenReturn(deserializedOid);
Insert insert = new Insert(mockedDBCollection, WriteConcern.NONE, getMapper().getMarshaller(), objectIdUpdater, getMapper().getQueryFactory());
insert.save(friend);