### Question:
DefaultXYZDataset extends AbstractXYZDataset implements XYZDataset, PublicCloneable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof DefaultXYZDataset)) { return false; } DefaultXYZDataset that = (DefaultXYZDataset) obj; if (!this.seriesKeys.equals(that.seriesKeys)) { return false; } for (int i = 0; i < this.seriesList.size(); i++) { double[][] d1 = this.seriesList.get(i); double[][] d2 = that.seriesList.get(i); double[] d1x = d1[0]; double[] d2x = d2[0]; if (!Arrays.equals(d1x, d2x)) { return false; } double[] d1y = d1[1]; double[] d2y = d2[1]; if (!Arrays.equals(d1y, d2y)) { return false; } double[] d1z = d1[2]; double[] d2z = d2[2]; if (!Arrays.equals(d1z, d2z)) { return false; } } return true; } DefaultXYZDataset(); @Override int getSeriesCount(); @Override Comparable getSeriesKey(int series); @Override int indexOf(Comparable seriesKey); @Override DomainOrder getDomainOrder(); @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 double getZValue(int series, int item); @Override Number getZ(int series, int item); void addSeries(Comparable seriesKey, double[][] data); void removeSeries(Comparable seriesKey); @Override boolean equals(Object obj); @Override int hashCode(); @Override Object clone();  }### Answer:
@Test public void testEquals() { DefaultXYZDataset d1 = new DefaultXYZDataset(); DefaultXYZDataset d2 = new DefaultXYZDataset(); assertEquals(d1, d2); assertEquals(d2, d1); double[] x1 = new double[] {1.0, 2.0, 3.0}; double[] y1 = new double[] {4.0, 5.0, 6.0}; double[] z1 = new double[] {7.0, 8.0, 9.0}; double[][] data1 = new double[][] {x1, y1, z1}; double[] x2 = new double[] {1.0, 2.0, 3.0}; double[] y2 = new double[] {4.0, 5.0, 6.0}; double[] z2 = new double[] {7.0, 8.0, 9.0}; double[][] data2 = new double[][] {x2, y2, z2}; d1.addSeries("S1", data1); assertFalse(d1.equals(d2)); d2.addSeries("S1", data2); assertEquals(d1, d2); }