### Question:
DefaultTableXYDataset extends AbstractIntervalXYDataset implements TableXYDataset, IntervalXYDataset, DomainInfo,
        PublicCloneable { public XYSeries getSeries(int series) { if ((series < 0) || (series >= getSeriesCount())) { throw new IllegalArgumentException("Index outside valid range."); } return this.data.get(series); } DefaultTableXYDataset();  DefaultTableXYDataset(boolean autoPrune); boolean isAutoPrune(); void addSeries(XYSeries series); void updateXPoints(); @Override int getSeriesCount(); @Override int getItemCount(); XYSeries getSeries(int series); @Override Comparable getSeriesKey(int series); @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 index); @Override Number getStartY(int series, int item); @Override Number getEndY(int series, int item); void removeAllSeries(); void removeSeries(XYSeries series); void removeSeries(int series); void removeAllValuesForX(Number x); void prune(); @Override void seriesChanged(SeriesChangeEvent event); @Override boolean equals(Object obj); @Override int hashCode(); @Override Object clone(); @Override double getDomainLowerBound(boolean includeInterval); @Override double getDomainUpperBound(boolean includeInterval); @Override Range getDomainBounds(boolean includeInterval); double getIntervalPositionFactor(); void setIntervalPositionFactor(double d); double getIntervalWidth(); void setIntervalWidth(double d); boolean isAutoWidth(); void setAutoWidth(boolean b);  }### Answer:
@Test public void testGetSeries() { DefaultTableXYDataset d1 = new DefaultTableXYDataset(); XYSeries s1 = new XYSeries("Series 1", true, false); d1.addSeries(s1); assertEquals("Series 1", d1.getSeries(0).getKey()); try { d1.getSeries(-1); fail("IllegalArgumentException should have been thrown on negative key"); } catch (IllegalArgumentException e) { assertEquals("Index outside valid range.", e.getMessage()); } try { d1.getSeries(1); fail("IllegalArgumentException should have been thrown on key out of range"); } catch (IllegalArgumentException e) { assertEquals("Index outside valid range.", e.getMessage()); } }