@Test
public void testToSparse() {

    DenseMatrix a = (DenseMatrix) createA(matrixFactory);
    SparseMatrix a2 = a.toSparse();
    assertNotNull(a2);
    assertSame(a2, a2.toSparse());
    DenseMatrix a3 = a2.toDense();
    assertEquals(a, a3);
}