private EnhancedApnsNotification makeNotification(final int code) {
        byte[] deviceToken = new byte[32];
        random.nextBytes(deviceToken);
        if (code == 0) {
            deviceToken[0] = 42;
        } else {
            deviceToken[0] = (byte) 0xff;
            deviceToken[1] = (byte) 0xff;

            if (code < -100) {
                // Drop connection
                deviceToken[2] = (byte) 2;
            } else if (code < 0) {
                // Sleep
                deviceToken[2] = (byte) 1;
                deviceToken[3] = (byte) -code;
            } else {
                // Send APNS error response then drop connection
                assert code > 0;
                deviceToken[2] = (byte) 0;
                deviceToken[3] = (byte) code;

            }

        }
        return new EnhancedApnsNotification(EnhancedApnsNotification.INCREMENT_ID(), 1, deviceToken, Utilities.toUTF8Bytes(payload));
    }
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