### Question:
DefaultIntervalXYDataset extends AbstractIntervalXYDataset implements PublicCloneable { @Override public Object clone() throws CloneNotSupportedException { DefaultIntervalXYDataset clone = (DefaultIntervalXYDataset) super.clone(); clone.seriesKeys = new java.util.ArrayList<Comparable>(this.seriesKeys); clone.seriesList = new ArrayList<double[][]>(this.seriesList.size()); for (int i = 0; i < this.seriesList.size(); i++) { double[][] data = this.seriesList.get(i); double[] x = data[0]; double[] xStart = data[1]; double[] xEnd = data[2]; double[] y = data[3]; double[] yStart = data[4]; double[] yEnd = data[5]; double[] xx = new double[x.length]; double[] xxStart = new double[xStart.length]; double[] xxEnd = new double[xEnd.length]; double[] yy = new double[y.length]; double[] yyStart = new double[yStart.length]; double[] yyEnd = new double[yEnd.length]; System.arraycopy(x, 0, xx, 0, x.length); System.arraycopy(xStart, 0, xxStart, 0, xStart.length); System.arraycopy(xEnd, 0, xxEnd, 0, xEnd.length); System.arraycopy(y, 0, yy, 0, y.length); System.arraycopy(yStart, 0, yyStart, 0, yStart.length); System.arraycopy(yEnd, 0, yyEnd, 0, yEnd.length); clone.seriesList.add(i, new double[][] {xx, xxStart, xxEnd, yy, yyStart, yyEnd}); } return clone; } DefaultIntervalXYDataset(); @Override int getSeriesCount(); @Override Comparable getSeriesKey(int series); @Override int getItemCount(int series); @Override double getXValue(int series, int item); @Override double getYValue(int series, int item); @Override double getStartXValue(int series, int item); @Override double getEndXValue(int series, int item); @Override double getStartYValue(int series, int item); @Override double getEndYValue(int series, int item); @Override Number getEndX(int series, int item); @Override Number getEndY(int series, int item); @Override Number getStartX(int series, int item); @Override Number getStartY(int series, int item); @Override Number getX(int series, int item); @Override Number getY(int series, int item); void addSeries(Comparable seriesKey, double[][] data); @Override boolean equals(Object obj); @Override int hashCode(); @Override Object clone();  }### Answer:
@Test public void testCloning() throws CloneNotSupportedException { DefaultIntervalXYDataset d1 = new DefaultIntervalXYDataset(); DefaultIntervalXYDataset d2 = (DefaultIntervalXYDataset) d1.clone(); assertNotSame(d1, d2); assertSame(d1.getClass(), d2.getClass()); assertEquals(d1, d2); d1 = createSampleDataset1(); d2 = (DefaultIntervalXYDataset) d1.clone(); assertNotSame(d1, d2); assertSame(d1.getClass(), d2.getClass()); assertEquals(d1, d2); }