Adds unit tests for replaceAllChildren.