@Test
public void testToArray() {

  final double[] values = {0, 1, 2, 3, 4, 5, 6, 7, 8};
  final Matrix3 mat3A = new Matrix3().fromArray(values);
  // row major
  final double[] dbls1 = mat3A.toArray(null);
  for (int i = 0; i < 9; i++) {
    assertTrue(values[i] == dbls1[i]);
  }
  // column major
  final double[] colmajor = {0, 3, 6, 1, 4, 7, 2, 5, 8};
  mat3A.toArray(dbls1, false);
  for (int i = 0; i < 9; i++) {
    assertTrue(colmajor[i] == dbls1[i]);
  }
}