Plot extends View implements Resizable { public synchronized boolean addSeries(FormatterType formatter, SeriesType... series) { for(SeriesType s : series) { if(!addSeries(s, formatter)) { return false; } } return true; } Plot(Context context, String title);  Plot(Context context, String title, RenderMode mode);  Plot(Context context, AttributeSet attrs);  Plot(Context context, AttributeSet attrs, int defStyle); DisplayDimensions getDisplayDimensions(); HashMap<Class<? extends RendererType>, RendererType> getRenderers(); RegistryType getRegistry(); void setRegistry(RegistryType registry); TextLabelWidget getTitle(); void setTitle(TextLabelWidget title); void setTitle(String title); void setRenderMode(RenderMode mode); RenderMode getRenderMode(); synchronized boolean addListener(PlotListener listener); synchronized boolean removeListener(PlotListener listener); synchronized boolean addSeries(FormatterType formatter, SeriesType... series); synchronized boolean addSeries(SeriesType series, FormatterType formatter); synchronized boolean removeSeries(SeriesType series, Class<? extends RendererType> rendererClass); synchronized void removeSeries(SeriesType series); void clear(); boolean isEmpty(); FormatterType getFormatter(SeriesType series, Class<? extends RendererType> rendererClass); T getRenderer(Class<T> rendererClass); List<RendererType> getRendererList(); void setMarkupEnabled(boolean enabled); void redraw(); @Override synchronized void layout(final DisplayDimensions dims); void setBorderStyle(BorderStyle style, Float radiusX, Float radiusY); LayoutManager getLayoutManager(); void setLayoutManager(LayoutManager layoutManager); Paint getBackgroundPaint(); void setBackgroundPaint(Paint backgroundPaint); void setPlotMargins(float left, float top, float right, float bottom); void setPlotPadding(float left, float top, float right, float bottom); float getPlotMarginTop(); void setPlotMarginTop(float plotMarginTop); float getPlotMarginBottom(); void setPlotMarginBottom(float plotMarginBottom); float getPlotMarginLeft(); void setPlotMarginLeft(float plotMarginLeft); float getPlotMarginRight(); void setPlotMarginRight(float plotMarginRight); float getPlotPaddingTop(); void setPlotPaddingTop(float plotPaddingTop); float getPlotPaddingBottom(); void setPlotPaddingBottom(float plotPaddingBottom); float getPlotPaddingLeft(); void setPlotPaddingLeft(float plotPaddingLeft); float getPlotPaddingRight(); void setPlotPaddingRight(float plotPaddingRight); Paint getBorderPaint(); void setBorderPaint(Paint borderPaint);  }
@Test public void testAddSeries() { Plot plot = new MockPlot("MockPlot"); MockSeries m1 = new MockSeries(); Class cl = MockRenderer1.class; plot.addSeries(m1, new MockFormatter1()); assertEquals(1, plot.getRegistry().size()); plot.addSeries(m1, new MockFormatter1()); assertEquals(1, plot.getRenderers().size()); assertEquals(2, plot.getRenderer(cl).getSeriesList().size()); MockSeries m2 = new MockSeries(); plot.addSeries(m2, new MockFormatter1()); assertEquals(1, plot.getRendererList().size()); assertEquals(3, plot.getRenderer(cl).getSeriesList().size()); plot.addSeries(m1, new MockFormatter2()); assertEquals(2, plot.getRendererList().size()); }