public abstract Factory factory();
@Test
public void testCreateMatrix() {
ByteMatrix a = factory().createMatrix();
ByteMatrix b = factory().createMatrix(5, 5);
ByteMatrix c = factory().createRandomMatrix(5, 5);
ByteMatrix d = factory().createSquareMatrix(5);
assertEquals(0, a.rows());
assertEquals(0, a.columns());
assertEquals(5, b.columns());
assertEquals(5, b.rows());
assertEquals(5, c.rows());
assertEquals(5, c.columns());
assertEquals(5, d.rows());
assertEquals(5, d.columns());
for (int i = 0; i < 5; i++) {
for (int j = 0; j < 5; j++)
{
assertEquals(0, b.get(i, j));
assertEquals(0, d.get(i, j));
}
}
}