@Test
public void removeOptimizerStateListener() {

	final MockOptimizer optimizer = new MockOptimizer(null, null, null, null, null);
	OptimizerStateListener l = new OptimizerStateListener() {
		@Override
		public void optimizationStarted(Optimizer optimizer) {
			// nothing to be done
		}
		@Override
		public void optimizationStopped(Optimizer optimizer) {
			// nothing to be done
		}
	};
	optimizer.addOptimizerStateListener(l);
	optimizer.removeOptimizerStateListener(l);
	Assert.assertTrue(optimizer.stateListeners.isEmpty());
}