@Test
public void testRemoveListener() {

    Plot plot = new MockPlot("MockPlot");
    ArrayList<PlotListener> listeners = plot.getListeners();
    assertEquals(0, listeners.size());
    MockPlotListener pl1 = new MockPlotListener();
    MockPlotListener pl2 = new MockPlotListener();
    MockPlotListener pl3 = new MockPlotListener();
    plot.addListener(pl1);
    plot.addListener(pl2);
    assertEquals(2, listeners.size());
    assertFalse(plot.removeListener(pl3));
    assertTrue(plot.removeListener(pl1));
    assertEquals(1, listeners.size());
    assertFalse(plot.removeListener(pl1));
    assertEquals(1, listeners.size());
    assertTrue(plot.removeListener(pl2));
    assertEquals(0, listeners.size());
}