Add unit test for Matrix class