@Test
public void testToString() {

  IntFunction<ArrayList<Integer>> mockFunction = mock(IntFunction.class);
  when(mockFunction.apply(any(int.class))).thenReturn(new ArrayList<>());
  Matrix matrix = new Matrix(1, 2, mockFunction);
  String stringOut = matrix.toString();
  Assert.assertTrue(stringOut.contains("width=2,"));
  Assert.assertTrue(stringOut.contains("height=1,"));
  Assert.assertTrue(stringOut.contains("matrix=[[]]"));
}