Refactor.
Implement method:

replaceObjectValuesreplaceObjectValuesWithNewValues.
Add test and fix implementation.

replaceObjectValuesWithNewValues