anchor.diff:              ?assertEqual(make_ref(), Other)
       end.
   
  -add_piece_update_case() ->
  -    {ok, _} = ?scarcity:start_link(9),
  +add_piece_update_case({N, Time, Pid}) ->
       {ok, Ref, _} = ?scarcity:watch(9, nine, pieces([0,2,4,6])),
       ok = ?scarcity:add_peer(9, pieces([])),
       ok = ?scarcity:add_piece(9, 2, pieces([2])),
  +    ?assertEqual(5000, ?timer:step(Time)),
  +    ?assertEqual(1, ?timer:fire(Time)),
       receive
           {scarcity, Ref, nine, Order} ->
               ?assertEqual([0,4,6,2], Order)
       end.
   
  -peer_exit_update_case() ->
  -    {ok, _} = ?scarcity:start_link(10),
  +aggregate_update_case({N, Time, Pid}) ->
  +    {ok, Ref, _} = ?scarcity:watch(N, aggr, pieces([0,2,4,6])),
  +    %% Assert that peer is limited by default
  +    ?assertEqual(5000, ?timer:step(Time)),
  +    ok = ?scarcity:add_peer(N, pieces([2])),
  +    ok = ?scarcity:add_piece(N, 0, pieces([0,2])),
  +    ?assertEqual(1, ?timer:fire(Time)),
  +    receive
  +        {scarcity, Ref, aggr, [4,6,0,2]} -> ok;
  +        Other -> ?assertEqual(make_ref(), Other)
  +        after 0 -> ?assert(false)
  +    end.
  +
  +noaggregate_update_case({N, Time, Pid}) ->
  +    {ok, Ref, _} = ?scarcity:watch(N, aggr, pieces([0,2,4,6])),
  +    %% Assert that peer is limited by default
  +    ?assertEqual(5000, ?timer:step(Time)),
  +    ok = ?scarcity:add_peer(N, pieces([2])),
  +    ?assertEqual(1, ?timer:fire(Time)),
  +    receive
  +        {scarcity, Ref, aggr, [0,4,6,2]} -> ok;
  +        O1 -> ?assertEqual(make_ref(), O1)
  +        after 0 -> ?assert(false)
  +    end,
  +    ok = ?scarcity:add_piece(N, 0, pieces([0,2])),
  +    ?assertEqual(1, ?timer:fire(Time)),
  +    receive
  +        {scarcity, Ref, aggr, [4,6,0,2]} -> ok;
  +        O2 -> ?assertEqual(make_ref(), O2)
  +        after 0 -> ?assert(false)
  +    end.
  +
  +
  +
  +peer_exit_update_case({N, Time, _}) ->
       Main = self(),
       Pid = spawn_link(fun() ->
           ok = ?scarcity:add_peer(10, pieces([0,1,2,3])),
  
positive.code:         fun(_) -> application:stop(gproc) end,
          [?_test(register_case()),
           ?_test(server_registers_case()),
           ?_test(initial_ordering_case()),
           ?_test(empty_ordering_case()),
           ?_test(init_pieceset_case()),
           ?_test(one_available_case()),
           ?_test(decrement_on_exit_case()),
           ?_test(init_watch_case()),
           ?_test(add_peer_update_case()),
           ?_test(add_piece_update_case()),
           ?_test(peer_exit_update_case()),
           ?_test(local_unwatch_case())]}.
  
  register_case() ->
      true = ?scarcity:register_scarcity_server(0),
  
negative.code:     {ok, O2} = ?scarcity:get_order(6, Pieces),
      ?assertEqual([0,1,2,3,4,5,6,7], O2).
  
  init_watch_case({N, Time, Pid}) ->
      {ok, Ref, Order} = ?scarcity:watch(7, seven, pieces([0,2,4,6])),
      ?assert(is_reference(Ref)),
      ?assertEqual([0,2,4,6], Order).
  
  add_peer_update_case({N, Time, Pid}) ->
      {ok, Ref, _} = ?scarcity:watch(8, eight, pieces([0,2,4,6])),
      ?assertEqual(1, ?timer:fire(Time)),
      ok = ?scarcity:add_peer(8, pieces([0,2])),
      receive
          {scarcity, Ref, Tag, Order} ->
  