### Question:
TimePeriodValuesCollection extends AbstractIntervalXYDataset implements IntervalXYDataset, DomainInfo, Serializable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof TimePeriodValuesCollection)) { return false; } TimePeriodValuesCollection that = (TimePeriodValuesCollection) obj; if (this.xPosition != that.xPosition) { return false; } if (!ObjectUtilities.equal(this.data, that.data)) { return false; } return true; } TimePeriodValuesCollection();  TimePeriodValuesCollection(TimePeriodValues series); TimePeriodAnchor getXPosition(); void setXPosition(TimePeriodAnchor position); @Override int getSeriesCount(); TimePeriodValues getSeries(int series); @Override Comparable getSeriesKey(int series); void addSeries(TimePeriodValues series); void removeSeries(TimePeriodValues series); void removeSeries(int index); @Override int getItemCount(int series); @Override Number getX(int series, int item); @Override Number getStartX(int series, int item); @Override Number getEndX(int series, int item); @Override Number getY(int series, int item); @Override Number getStartY(int series, int item); @Override Number getEndY(int series, int item); @Override double getDomainLowerBound(boolean includeInterval); @Override double getDomainUpperBound(boolean includeInterval); @Override Range getDomainBounds(boolean includeInterval); @Override boolean equals(Object obj);  }### Answer:
@Test public void testEquals() { TimePeriodValuesCollection c1 = new TimePeriodValuesCollection(); TimePeriodValuesCollection c2 = new TimePeriodValuesCollection(); assertEquals(c1, c2); c1.setXPosition(TimePeriodAnchor.END); assertFalse(c1.equals(c2)); c2.setXPosition(TimePeriodAnchor.END); assertEquals(c1, c2); TimePeriodValues v1 = new TimePeriodValues("Test"); TimePeriodValues v2 = new TimePeriodValues("Test"); c1.addSeries(v1); assertFalse(c1.equals(c2)); c2.addSeries(v2); assertEquals(c1, c2); }