@Test
public void injectListeners() {

	final MockOptimizer optimizer = new MockOptimizer(null, null, null, null, null);
	OptimizerIterationListener l1 = (int iteration) -> {
		// nothing to be done
	};
	OptimizerStateListener l2 = new OptimizerStateListener() {
		@Override
		public void optimizationStarted(Optimizer optimizer) {
			// nothing to be done
		}
		@Override
		public void optimizationStopped(Optimizer optimizer) {
			// nothing to be done
		}
	};
	optimizer.injectListeners(Collections.singleton(l2), Collections.singleton(l1));
	Assert.assertSame(l1, optimizer.iterationListeners.iterator().next());
	Assert.assertSame(l2, optimizer.stateListeners.iterator().next());
}