### Question:
VectorSeriesCollection extends AbstractXYDataset implements VectorXYDataset, PublicCloneable, Serializable { public void addSeries(VectorSeries series) { ParamChecks.nullNotPermitted(series, "series"); this.data.add(series); series.addChangeListener(this); fireDatasetChanged(); } VectorSeriesCollection(); void addSeries(VectorSeries series); boolean removeSeries(VectorSeries series); void removeAllSeries(); @Override int getSeriesCount(); VectorSeries getSeries(int series); @Override Comparable getSeriesKey(int series); int indexOf(VectorSeries series); @Override int getItemCount(int series); @Override double getXValue(int series, int item); @Override Number getX(int series, int item); @Override double getYValue(int series, int item); @Override Number getY(int series, int item); @Override Vector getVector(int series, int item); @Override double getVectorXValue(int series, int item); @Override double getVectorYValue(int series, int item); @Override boolean equals(Object obj); @Override Object clone();  }### Answer:
@Test public void testSerialization() throws IOException, ClassNotFoundException { VectorSeries s1 = new VectorSeries("Series"); s1.add(1.0, 1.1, 1.2, 1.3); VectorSeriesCollection c1 = new VectorSeriesCollection(); c1.addSeries(s1); ByteArrayOutputStream buffer = new ByteArrayOutputStream(); ObjectOutput out = new ObjectOutputStream(buffer); out.writeObject(c1); out.close(); ObjectInput in = new ObjectInputStream( new ByteArrayInputStream(buffer.toByteArray())); VectorSeriesCollection c2 = (VectorSeriesCollection) in.readObject(); in.close(); assertEquals(c1, c2); }
@Test public void testSerialization() { VectorSeries s1 = new VectorSeries("Series"); s1.add(1.0, 1.1, 1.2, 1.3); VectorSeriesCollection c1 = new VectorSeriesCollection(); c1.addSeries(s1); VectorSeriesCollection c2 = (VectorSeriesCollection) TestUtils.serialised(c1); assertEquals(c1, c2); }