anchor.diff:                    key    = "KEY"},
         random:uniform(10),
         "chime"),
  -  receive
  -    {'DOWN', Ref, _, _, _} = DownMsg2 ->
  -      throw(DownMsg2);
  -    DownMsg2 ->
  -      throw(DownMsg2)
  -    after 1000 ->
  -      ok
  -  end,
  +  monitor_process_for_a_second(Ref),
  +
     ok =
       apns:send_message(
         ?TEST_CONNECTION, ?DEVICE_TOKEN, #loc_alert{key = "EMPTY"},
         random:uniform(10), "chime"),
  -  receive
  -    {'DOWN', Ref, _, _, _} = DownMsg3 ->
  -      throw(DownMsg3);
  -    DownMsg3 ->
  -      throw(DownMsg3)
  -    after 1000 ->
  -      ok
  -  end,
  +  monitor_process_for_a_second(Ref),
  +
     ok =
       apns:send_message(
         ?TEST_CONNECTION, ?DEVICE_TOKEN, Now ++ " - Test Alert",
         random:uniform(10), "chime",
         apns:expiry(86400), [{<<"acme1">>, 1}]),
  -  receive
  -    {'DOWN', Ref, _, _, _} = DownMsg4 ->
  -      throw(DownMsg4);
  -    DownMsg4 ->
  -      throw(DownMsg4)
  -    after 1000 ->
  -      ok
  -  end,
  +  monitor_process_for_a_second(Ref),
  +
     ok =
       apns:send_message(
         ?TEST_CONNECTION, ?DEVICE_TOKEN,
  
positive.code:       apns:expiry(86400),
        [ {<<"acme2">>, <<"x">>},
          {<<"acme3">>, {[{<<"acme4">>, false}]}}]),
    receive
      {'DOWN', Ref, _, _, _} = DownMsg5 ->
        throw(DownMsg5);
      DownMsg5 ->
        throw(DownMsg5)
      after 1000 ->
        ok
    end,
    ok = apns:send_message(?TEST_CONNECTION, #apns_msg{device_token = ?DEVICE_TOKEN,
                                   sound = "chime",
                                   badge = 12,
                                   expiry = apns:expiry(86400),
                                   alert = "Low Priority alert",
                                   priority = 0}),
    receive
      {'DOWN', Ref, _, _, _} = DownMsg6 ->
        throw(DownMsg6);
      DownMsg6 ->
        throw(DownMsg6)
      after 1000 ->
        ok
    end.
  
  log_error(MsgId, Status) ->
    error_logger:error_msg("Error on msg ~p: ~p~n", [MsgId, Status]).
  
  log_feedback(Token) ->
    error_logger:warning_msg("Device with token ~p removed the app~n", [Token]).
negative.code:     apns:send_message(
        ?TEST_CONNECTION, ?DEVICE_TOKEN,
        Now ++ " - Test Alert", random:uniform(10), "chime"),
    monitor_process_for_a_second(Ref),
  
    ok =
      apns:send_message(
        ?TEST_CONNECTION,
  