Added unittest for replacing an item in an array.