Add unit tests for copyArray()
Add implementation of copyArray()

All unit tests PASS.