### Question:
DefaultXYDataset extends AbstractXYDataset implements XYDataset, PublicCloneable { @Override public int indexOf(Comparable seriesKey) { return this.seriesKeys.indexOf(seriesKey); } DefaultXYDataset(); @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); 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 testIndexOf() { DefaultXYDataset d = createSampleDataset1(); assertEquals(0, d.indexOf("S1")); assertEquals(1, d.indexOf("S2")); assertEquals(-1, d.indexOf("Green Eggs and Ham")); assertEquals(-1, d.indexOf(null)); }