@Test
public void test() throws InterruptedException {

    Executor executor = Executors.newCachedThreadPool(DaemonThreadFactory.INSTANCE);
    WorkerPool<AtomicLong> pool = new WorkerPool<AtomicLong>(new AtomicLongEventFactory(),
        new FatalExceptionHandler(), new AtomicLongWorkHandler(), new AtomicLongWorkHandler());
    RingBuffer<AtomicLong> ringBuffer = pool.start(executor);
    ringBuffer.next();
    ringBuffer.next();
    ringBuffer.publish(0);
    ringBuffer.publish(1);
    Thread.sleep(500);
    Assert.assertThat(ringBuffer.get(0).get(), is(1L));
    Assert.assertThat(ringBuffer.get(1).get(), is(1L));
}