### Question:
DefaultStatisticalCategoryDataset extends AbstractDataset implements StatisticalCategoryDataset, RangeInfo, PublicCloneable { public void add(double mean, double standardDeviation, Comparable rowKey, Comparable columnKey) { add(new Double(mean), new Double(standardDeviation), rowKey, columnKey); } DefaultStatisticalCategoryDataset(); @Override Number getMeanValue(int row, int column); @Override Number getValue(int row, int column); @Override Number getValue(Comparable rowKey, Comparable columnKey); @Override Number getMeanValue(Comparable rowKey, Comparable columnKey); @Override Number getStdDevValue(int row, int column); @Override Number getStdDevValue(Comparable rowKey, Comparable columnKey); @Override int getColumnIndex(Comparable key); @Override Comparable getColumnKey(int column); @Override List<Comparable> getColumnKeys(); @Override int getRowIndex(Comparable key); @Override Comparable getRowKey(int row); @Override List<Comparable> getRowKeys(); @Override int getRowCount(); @Override int getColumnCount(); void add(double mean, double standardDeviation,
                    Comparable rowKey, Comparable columnKey); void add(Number mean, Number standardDeviation,
                    Comparable rowKey, Comparable columnKey); void remove(Comparable rowKey, Comparable columnKey); void removeRow(int rowIndex); void removeRow(Comparable rowKey); void removeColumn(int columnIndex); void removeColumn(Comparable columnKey); void clear(); @Override double getRangeLowerBound(boolean includeInterval); @Override double getRangeUpperBound(boolean includeInterval); @Override Range getRangeBounds(boolean includeInterval); @Override boolean equals(Object obj); @Override Object clone();  }### Answer:
@Test public void testSerialization1() throws IOException, ClassNotFoundException { DefaultStatisticalCategoryDataset d1 = new DefaultStatisticalCategoryDataset(); d1.add(1.1, 2.2, "R1", "C1"); d1.add(3.3, 4.4, "R1", "C2"); d1.add(null, 5.5, "R1", "C3"); d1.add(6.6, null, "R2", "C3"); ByteArrayOutputStream buffer = new ByteArrayOutputStream(); ObjectOutput out = new ObjectOutputStream(buffer); out.writeObject(d1); out.close(); ObjectInput in = new ObjectInputStream( new ByteArrayInputStream(buffer.toByteArray())); DefaultStatisticalCategoryDataset d2 = (DefaultStatisticalCategoryDataset) in.readObject(); in.close(); assertEquals(d1, d2); }
@Test public void testSerialization2() throws IOException, ClassNotFoundException { DefaultStatisticalCategoryDataset d1 = new DefaultStatisticalCategoryDataset(); d1.add(1.2, 3.4, "Row 1", "Column 1"); ByteArrayOutputStream buffer = new ByteArrayOutputStream(); ObjectOutput out = new ObjectOutputStream(buffer); out.writeObject(d1); out.close(); ObjectInput in = new ObjectInputStream( new ByteArrayInputStream(buffer.toByteArray())); DefaultStatisticalCategoryDataset d2 = (DefaultStatisticalCategoryDataset) in.readObject(); in.close(); assertEquals(d1, d2); }
@Test public void testAdd() { DefaultStatisticalCategoryDataset d1 = new DefaultStatisticalCategoryDataset(); d1.add(1.0, 2.0, "R1", "C1"); assertEquals(1.0, d1.getValue("R1", "C1").doubleValue(), EPSILON); assertEquals(2.0, d1.getStdDevValue("R1", "C1").doubleValue(), EPSILON); d1.add(10.0, 20.0, "R1", "C1"); assertEquals(10.0, d1.getValue("R1", "C1").doubleValue(), EPSILON); assertEquals(20.0, d1.getStdDevValue("R1", "C1").doubleValue(), EPSILON); }