### Question:
Matrix { public boolean equals(Matrix matrix) { return height == matrix.height && width == matrix.width && Arrays.equals(data, matrix.data); } Matrix(int height, int width, double[] data);  Matrix(int height, int width);  Matrix(int height, int width, double value); boolean equals(Matrix matrix); Matrix multiplyWithTime(Matrix matrix); Matrix multiply(Matrix matrix); Matrix multiplyNativeWithTime(Matrix matrix); Matrix multiplyNative(Matrix matrix); Matrix powerWithTime(int k); Matrix power(int k); Matrix powerNativeWithTime(int k); Matrix powerNative(int k);  }### Answer:
@Test public void testEquals() { Matrix matrix1 = new Matrix(2, 2, new double[]{1, 2, 3, 4}); Matrix matrix2 = new Matrix(2, 2, new double[]{1, 2, 3, 4}); Matrix matrix3 = new Matrix(2, 3, new double[]{1, 2, 3, 4, 5, 6}); Matrix matrix4 = new Matrix(0, 0, new double[]{}); Assert.assertTrue(matrix1.equals(matrix1)); Assert.assertTrue(matrix1.equals(matrix2)); Assert.assertFalse(matrix1.equals(matrix3)); Assert.assertFalse(matrix1.equals(matrix4)); }