Added ReplaceEntityTest.