@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());
    // a new copy of m1 is added:
    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());
    // still should only be one renderer type:
    assertEquals(1, plot.getRendererList().size());
    // we added a new instance of cl to the renderer so there should be 3 in the subregistry:
    assertEquals(3, plot.getRenderer(cl).getSeriesList().size());
    // lets add another renderer:
    plot.addSeries(m1, new MockFormatter2());
    assertEquals(2, plot.getRendererList().size());
}