### Question:
MatrixSeries extends Series implements Serializable { public void update(int i, int j, double mij) { this.data[i][j] = mij; fireSeriesChanged(); } 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 testCloning() throws CloneNotSupportedException { MatrixSeries m1 = new MatrixSeries("Test", 8, 3); m1.update(0, 0, 11.0); m1.update(7, 2, 22.0); MatrixSeries m2 = (MatrixSeries) m1.clone(); assertNotSame(m1, m2); assertSame(m1.getClass(), m2.getClass()); assertEquals(m1, m2); }
@Test public void testSerialization() throws IOException, ClassNotFoundException { MatrixSeries m1 = new MatrixSeries("Test", 8, 3); m1.update(0, 0, 11.0); m1.update(7, 2, 22.0); ByteArrayOutputStream buffer = new ByteArrayOutputStream(); ObjectOutput out = new ObjectOutputStream(buffer); out.writeObject(m1); out.close(); ObjectInput in = new ObjectInputStream( new ByteArrayInputStream(buffer.toByteArray())); MatrixSeries m2 = (MatrixSeries) in.readObject(); in.close(); assertEquals(m1, m2); }