anchor.diff:  
                       %% Increment it.
                       {ok, _} = lasp:update(Ad, increment, Id),
  -                    lager:info("Incremented ad counter: ~p", [Ad]),
   
                       client(Id, AdsWithContracts, AdList0)
               end
       end.
  +
  +%% @doc Simulate clients viewing advertisements.
  +simulate(ClientList) ->
  +    %% Start the simulation.
  +    Viewer = fun(_) ->
  +            Random = random:uniform(length(ClientList)),
  +            Pid = lists:nth(Random, ClientList),
  +            Pid ! view_ad
  +    end,
  +    lists:foreach(Viewer, lists:seq(1, ?NUM_EVENTS)).
  +
  +%% @doc Launch a server process for each advertisement, which will block
  +%% until the advertisement should be disabled.
  +servers(Ads, AdsWithContracts) ->
  +    %% Create a OR-set for the server list.
  +    {ok, Servers} = lasp:declare(?SET),
  +
  +    %% Get the current advertisement list.
  +    {ok, {_, _, AdList0}} = lasp:read(AdsWithContracts, {strict, undefined}),
  +    AdList = ?SET:value(AdList0),
  +
  +    %% For each advertisement, launch one server for tracking it's
  +    %% impressions and wait to disable.
  +    lists:map(fun(Ad) ->
  +                ServerPid = spawn_link(?MODULE, server, [Ad, Ads]),
  +                {ok, _} = lasp:update(Servers, {add, ServerPid}, undefined),
  +                ServerPid
  +                end, AdList).
  +
  +%% @doc Launch a series of client processes, each of which is responsible
  +%% for displaying a particular advertisement.
  +clients(AdsWithContracts) ->
  +    %% Generate a OR-set for tracking clients.
  +    {ok, Clients} = lasp:declare(?SET),
  +
  +    %% Each client takes the full list of ads when it starts, and reads
  +    %% from the variable store.
  +    lists:map(fun(Id) ->
  +                ClientPid = spawn_link(?MODULE, client, [Id, AdsWithContracts, undefined]),
  +                {ok, _} = lasp:update(Clients, {add, ClientPid}, undefined),
  +                ClientPid
  +                end, lists:seq(1, ?NUM_CLIENTS)).
  +
  +%% @doc Summarize results.
  +summarize(AdsWithContracts) ->
  +    %% Wait until all advertisements have been exhausted before stopping
  +    %% execution of the test.
  +    {ok, {_, _, AdsWithContracts0}} = lasp:read(AdsWithContracts, {strict, undefined}),
  +    Overcounts = lists:map(fun({#ad{counter=CounterId}, _}) ->
  +                lager:info("Waiting for advertisement ~p to reach ~p impressions...",
  +                           [CounterId, ?MAX_IMPRESSIONS]),
  +                {ok, {_, _, V0}} = lasp:read(CounterId, ?MAX_IMPRESSIONS),
  +                V = ?COUNTER:value(V0),
  +                lager:info("Advertisement ~p reached max impressions: ~p with ~p....",
  +                           [CounterId, ?MAX_IMPRESSIONS, V]),
  +                V - ?MAX_IMPRESSIONS
  +        end, ?SET:value(AdsWithContracts0)),
  +
  +    Sum = fun(X, Acc) ->
  +            X + Acc
  +    end,
  +    TotalOvercount = lists:foldl(Sum, 0, Overcounts),
  +    io:format("----------------------------------------"),
  +    io:format("Total overcount: ~p~n", [TotalOvercount]),
  +    io:format("Mean overcount per client: ~p~n", [TotalOvercount / ?NUM_CLIENTS]),
  +    io:format("----------------------------------------"),
  +
  +    ok.
  
positive.code: 
  -define(COUNTER, riak_dt_gcounter).
  
  -record(ad, {id, image, counter}).
  
  -record(contract, {id}).
  
negative.code:     {ok, Ads} = lasp:declare(?SET),
      ok = lasp:union(RovioAds, TriforkAds, Ads),
  
      %% For each identifier, generate a contract.
      {ok, Contracts} = lasp:declare(?SET),
      lists:map(fun(Id) ->
  