### Question:
MatrixSeries extends Series implements Serializable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof MatrixSeries)) { return false; } MatrixSeries that = (MatrixSeries) obj; if (!(getRowCount() == that.getRowCount())) { return false; } if (!(getColumnsCount() == that.getColumnsCount())) { return false; } for (int r = 0; r < getRowCount(); r++) { for (int c = 0; c < getColumnsCount(); c++) { if (get(r, c) != that.get(r, c)) { return false; } } } return super.equals(obj); } MatrixSeries(String name, int rows, int columns); int getColumnsCount(); Number getItem(int itemIndex); int getItemColumn(int itemIndex); @Override int getItemCount(); int getItemRow(int itemIndex); int getRowCount(); double get(int i, int j); void update(int i, int j, double mij); void zeroAll(); @Override boolean equals(Object obj);  }### Answer:
@Test public void testEquals() { MatrixSeries m1 = new MatrixSeries("Test", 8, 3); m1.update(0, 0, 11.0); m1.update(7, 2, 22.0); MatrixSeries m2 = new MatrixSeries("Test", 8, 3); m2.update(0, 0, 11.0); m2.update(7, 2, 22.0); assertEquals(m1, m2); assertEquals(m2, m1); m1 = new MatrixSeries("Test 2", 8, 3); assertFalse(m1.equals(m2)); m2 = new MatrixSeries("Test 2", 8, 3); assertEquals(m1, m2); m1 = new MatrixSeries("Test 2", 10, 3); assertFalse(m1.equals(m2)); m2 = new MatrixSeries("Test 2", 10, 3); assertEquals(m1, m2); m1 = new MatrixSeries("Test 2", 10, 5); assertFalse(m1.equals(m2)); m2 = new MatrixSeries("Test 2", 10, 5); assertEquals(m1, m2); m1.update(0, 0, 99); assertFalse(m1.equals(m2)); m2.update(0, 0, 99); assertEquals(m1, m2); }