Added test for copy on modification while iterating in preorder