@Test
public void testToArray() {

  final double[] values = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15};
  final Matrix4 mat4A = new Matrix4().fromArray(values);
  // row major
  final double[] dbls1 = mat4A.toArray(null);
  for (int i = 0; i < 16; i++) {
    assertTrue(values[i] == dbls1[i]);
  }
  // column major
  final double[] colmajor = {0, 4, 8, 12, 1, 5, 9, 13, 2, 6, 10, 14, 3, 7, 11, 15};
  mat4A.toArray(dbls1, false);
  for (int i = 0; i < 16; i++) {
    assertTrue(colmajor[i] == dbls1[i]);
  }
}