Created 'replaceWith()' method and tested.