}
@Test
public void shouldSupportCombiningWorkerPoolWithEventHandlerAsDependencyWhenNotPreviouslyRegistered() throws Exception
{
final TestWorkHandler workHandler1 = createTestWorkHandler();
final DelayedEventHandler delayedEventHandler1 = createDelayedEventHandler();
final DelayedEventHandler delayedEventHandler2 = createDelayedEventHandler();
disruptor.handleEventsWith(delayedEventHandler1).and(disruptor.handleEventsWithWorkerPool(workHandler1)).then(delayedEventHandler2);
publishEvent();
publishEvent();
delayedEventHandler1.processEvent();
delayedEventHandler1.processEvent();
workHandler1.processEvent();
delayedEventHandler2.processEvent();
workHandler1.processEvent();
delayedEventHandler2.processEvent();
}