Extracted TestBuildIdentityMatrix.