Add unit test for array cloning

Change-Id: Ia2b458dcce396ec033506b64655a95524cf70151