@Test
public void testDensePrintWithNames() throws IOException {

    Matrix a = createA(matrixFactory);
    String expected = String.join(System.lineSeparator(),
            "     c1  c2",
            " r1 1.0 0.0",
            " r2 0.0 3.0",
            " r3 2.0 0.0")
            + System.lineSeparator();
    assertEquals(expected, print(a, ImmutableList.of("r1", "r2", "r3"), ImmutableList.of("c1", "c2")));
}