### Question:
OHLCSeriesCollection extends AbstractXYDataset implements OHLCDataset, Serializable { public void removeSeries(int index) { OHLCSeries series = getSeries(index); if (series != null) { removeSeries(series); } } OHLCSeriesCollection(); TimePeriodAnchor getXPosition(); void setXPosition(TimePeriodAnchor anchor); void addSeries(OHLCSeries series); @Override int getSeriesCount(); OHLCSeries getSeries(int series); @Override Comparable getSeriesKey(int series); @Override int getItemCount(int series); @Override double getXValue(int series, int item); @Override Number getX(int series, int item); @Override Number getY(int series, int item); @Override double getOpenValue(int series, int item); @Override Number getOpen(int series, int item); @Override double getCloseValue(int series, int item); @Override Number getClose(int series, int item); @Override double getHighValue(int series, int item); @Override Number getHigh(int series, int item); @Override double getLowValue(int series, int item); @Override Number getLow(int series, int item); @Override Number getVolume(int series, int item); @Override double getVolumeValue(int series, int item); void removeSeries(int index); boolean removeSeries(OHLCSeries series); void removeAllSeries(); @Override boolean equals(Object obj); @Override int hashCode(); @Override Object clone();  }### Answer:
@Test public void testRemoveSeries() { OHLCSeriesCollection c1 = new OHLCSeriesCollection(); OHLCSeries s1 = new OHLCSeries("Series 1"); OHLCSeries s2 = new OHLCSeries("Series 2"); OHLCSeries s3 = new OHLCSeries("Series 3"); OHLCSeries s4 = new OHLCSeries("Series 4"); c1.addSeries(s1); c1.addSeries(s2); c1.addSeries(s3); c1.addSeries(s4); c1.removeSeries(s3); assertEquals(c1.getSeries(2), s4); c1.removeSeries(s1); assertEquals(c1.getSeries(0), s2); assertEquals(2, c1.getSeriesCount()); }