anchor.diff:              {high_watermark, 0.6},
               {queue_qos0, false}],
       Q = ?Q:new("priority_queue", Opts, alarm_fun()),
  +    ?assertEqual(priority, ?Q:type(Q)),
  +    ?assertEqual(3, ?Q:max_len(Q)),
  +    ?assertEqual(<<"priority_queue">>, ?Q:name(Q)),
   
       ?assert(?Q:is_empty(Q)),
       Q1 = ?Q:in(#mqtt_message{qos = 1, topic = <<"t1">>}, Q),
  
positive.code:             {high_watermark, 0.6},
              {queue_qos0, false}],
      Q = ?Q:new("simple_queue", Opts, alarm_fun()),
  
      ?assert(?Q:is_empty(Q)),
      Q1 = ?Q:in(#mqtt_message{qos = 1, payload = <<"1">>}, Q),
      Q2 = ?Q:in(#mqtt_message{qos = 1, payload = <<"2">>}, Q1),
  
negative.code:     ?assertEqual(5, ?Q:len(Q6)),
      {{value, Msg}, Q7} = ?Q:out(Q6),
      ?assertMatch(<<"t">>, Msg#mqtt_message.topic).
  
  infinity_priority_mqueue_test() ->
      Opts = [{type, priority},
              {priority, [{<<"t1">>, 10}, {<<"t2">>, 8}]},
              {max_length, infinity},
              {queue_qos0, false}],
      Q = ?Q:new("infinity_priority_queue", Opts, alarm_fun()),
      ?assertEqual(infinity, ?Q:max_len(Q)),
      Qx = lists:foldl(fun(I, AccQ) ->
                      AccQ1 =
                      ?Q:in(#mqtt_message{topic = <<"t1">>, qos = 1, payload = iolist_to_binary([I])}, AccQ),
                      ?Q:in(#mqtt_message{topic = <<"t">>, qos = 1, payload = iolist_to_binary([I])}, AccQ1)
              end, Q, lists:seq(1, 255)),
      ?assertEqual(510, ?Q:len(Qx)),
      ?assertEqual([{len, 510}, {max_len, infinity}, {dropped, 0}], ?Q:stats(Qx)).
   
  alarm_fun() -> fun(_, _) -> alarm_fun() end.
  
  