AbstractOptimizer implements Optimizer { @Override public void removeOptimizerStateListener(OptimizerStateListener listener) { stateListeners.remove(listener); } AbstractOptimizer(Population population, Archive archive, IndividualCompleter completer, Control control,
			Iteration iteration); @Override int getIteration(); @Override boolean isRunning(); @Override void startOptimization(); @Override void stopOptimization(); @Override void addOptimizerIterationListener(OptimizerIterationListener listener); @Override void addOptimizerStateListener(OptimizerStateListener listener); @Override void removeOptimizerIterationListener(OptimizerIterationListener listener); @Override void removeOptimizerStateListener(OptimizerStateListener listener);  }
@Test public void removeOptimizerStateListener() { final MockOptimizer optimizer = new MockOptimizer(null, null, null, null, null); OptimizerStateListener l = new OptimizerStateListener() { @Override public void optimizationStarted(Optimizer optimizer) { } @Override public void optimizationStopped(Optimizer optimizer) { } }; optimizer.addOptimizerStateListener(l); optimizer.removeOptimizerStateListener(l); Assert.assertTrue(optimizer.stateListeners.isEmpty()); }