@Override
    public void onEvent(final FizzBuzzEvent event, final long sequence, final boolean endOfBatch) throws Exception
    {
        switch (fizzBuzzStep)
        {
            case FIZZ:
                if (0 == (event.getValue() % 3))
                {
                    event.setFizz(true);
                }
                break;

            case BUZZ:
                if (0 == (event.getValue() % 5))
                {
                    event.setBuzz(true);
                }
                break;

            case FIZZ_BUZZ:
                if (event.isFizz() && event.isBuzz())
                {
                    fizzBuzzCounter.set(fizzBuzzCounter.get() + 1L);
                }
                break;
        }

        if (latch != null && count == sequence)
        {
            latch.countDown();
        }
    }