@Test public void addOptimizerStateListener() { 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); Assert.assertEquals(1, optimizer.stateListeners.size()); Assert.assertSame(l, optimizer.stateListeners.iterator().next()); }
@Override public void addOptimizerStateListener(OptimizerStateListener listener) { stateListeners.add(listener); }
AbstractOptimizer implements Optimizer { @Override public void addOptimizerStateListener(OptimizerStateListener listener) { stateListeners.add(listener); } }
AbstractOptimizer implements Optimizer { @Override public void addOptimizerStateListener(OptimizerStateListener listener) { stateListeners.add(listener); } AbstractOptimizer(Population population, Archive archive, IndividualCompleter completer, Control control,
			Iteration iteration); }
AbstractOptimizer implements Optimizer { @Override public void addOptimizerStateListener(OptimizerStateListener listener) { stateListeners.add(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); }
AbstractOptimizer implements Optimizer { @Override public void addOptimizerStateListener(OptimizerStateListener listener) { stateListeners.add(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);  }