SeriesRegistry implements Serializable { public boolean add(SeriesType series, FormatterType formatter) { if(series == null || formatter == null) { throw new IllegalArgumentException("Neither series nor formatter param may be null."); } return registry.add(newSeriesBundle(series, formatter)); }  List<BundleType> getSeriesAndFormatterList(); List<SeriesType> getSeriesList(); int size(); boolean isEmpty(); boolean add(SeriesType series, FormatterType formatter); synchronized List<BundleType> remove(SeriesType series, Class rendererClass); synchronized boolean remove(SeriesType series); void clear(); List<SeriesBundle<SeriesType, FormatterType>> getLegendEnabledItems(); boolean contains(SeriesType series, Class<? extends FormatterType> formatterClass);  }
@Test public void testAdd() { assertEquals(0, seriesRegistry.size()); seriesRegistry.add(new SimpleXYSeries("s1"), new LineAndPointFormatter()); assertEquals(1, seriesRegistry.size()); }
@Test public void testAdd_failsOnNullArgument() throws Exception { try { seriesRegistry.add(null, null); fail("IllegalArgumentException expected."); } catch(IllegalArgumentException e) { } try { seriesRegistry.add(new SimpleXYSeries("s1"), null); fail("IllegalArgumentException expected."); } catch(IllegalArgumentException e) { } try { seriesRegistry.add(null, new LineAndPointFormatter()); fail("IllegalArgumentException expected."); } catch(IllegalArgumentException e) { } }