public void testAddListenerAfterCompletion() throws Throwable {
final NormalExecutionJobDispatcher dispatcher = new NormalExecutionJobDispatcher();
final PlanExecutor executor = new PlanExecutor(createCycle(dispatcher), createPlan());
dispatcher.execute(executor);
final AtomicReference<String> result = new AtomicReference<String>();
executor.setListener(new Listener() {
@Override
public void graphCompleted(final String calculationConfiguration) {
assertEquals(result.getAndSet(calculationConfiguration), null);
}
});