protected void assertNumberReceived(final int count) throws InterruptedException {
        logger.debug("assertNumberReceived {}", count);
        int i = 0;
        try {
            for (; i < count; ++i) {
                ApnsServerSimulator.Notification notification = server.getQueue().poll(5, TimeUnit.SECONDS);
                logger.debug("Polled notification {}", notification);
                if (notification == null)
                    throw new RuntimeException("poll timed out");
            }
        } catch (RuntimeException re) {
            logger.error("Exception in assertNumberReceived, took {}", i);
            throw re;
        }
        logger.debug("assertNumberReceived - successfully took {}", count);
        assertIdle();
    }
Create an APNS notification that creates specified "error" behaviour in the
{@link com.notnoop.apns.utils.Simulator.FailingApnsServerSimulator}

@param code A code specifying the FailingApnsServer's behaviour.
            <ul>
            <li>-100: Drop connection</li>
            <li>below zero: wait (-code) number times a tenth of a second</li>
            <li>above zero: send code as APNS error message then drop connection</li>
            </ul>
@return an APNS notification
src/test/java/com/notnoop/apns/integration/ApnsSimulatorTestBase.java