anchor.diff:      %% Slow down a link. One replica should not receive any prbr messages during the
       %% test. After the slow link is removed (messages will be flushed), all replicase should
       %% be consistent. Assumes R=4.
  -    get_notified_by_message(self(), 1, kv_db, 2, dht_node, write),
  -    Link = slow_link(1, kv_db, 2, dht_node),
  +    get_notified_by_message(1, 2, write),
  +    Link = slow_link(1, 2),
       {ok, _} = write_via_node(1, "1", filter_list_append(), "TestWrite"),
   
       %% replica 2 should be empty, and the other three have the value written
  
positive.code:     % Write A: Write only to replica 1
      ct:pal("partial write to replica 1"),
      print_prbr_data(),
      [get_notified_by_message(self(), 1, kv_db, I, dht_node, write) || I<-lists:seq(1, 1)],
      _LinkA = [slow_link(1, kv_db, I, dht_node, write) || I <- lists:seq(2, 4)],
      spawn(fun() -> write_via_node(1, Key, filter_list_append(), "WriteA") end),
      [receive {message_received} -> ok end || _ <- lists:seq(1, 1)],
      print_prbr_data(),
  
      %% Execute read B
      ct:pal("inconsistent read"),
      [get_notified_by_message(self(), 2, kv_db, I, dht_node, read) || I<-lists:seq(1, 1)],
      _LinkB = [slow_link(2, kv_db, I, dht_node, read) || I <- lists:seq(2, 4)],
      LinkC = slow_link(2, kv_db, 4, dht_node, round_request),
      spawn(fun() ->
          {ok, Value} = read_via_node(2, Key, element(1, filter_list_append())),
              TestPid ! {read_req_done, Value}
          end),
      % message_received -> internally seen inconsistent quorum and moved to read stage
      [receive {message_received} -> ok end || _ <- lists:seq(1, 1)],
      print_prbr_data(),
      %% deliver slow messages from replica 4
      ct:pal("remove slow link"),
  
negative.code:     TestPid = self(),
      Key = "123",
  
      % Write A: Write to replica 1-3
      ct:pal("write to replica 1-3"),
      print_prbr_data(),
      get_notified_by_message(1, [1,2,3], write),
      _ = slow_link(1, 4, write),
      spawn(fun() -> write_via_node(1, Key, filter_list_append(), "WriteA") end),
      wait_until_notification(3),
      print_prbr_data(),
  
      %% Execute read B
      ct:pal("inconsistent read"),
      get_notified_by_message(2, 4, read),
      _ = slow_link(2, [1,2,3], read),
      LinkC = slow_link(2, 1, round_request),
      spawn(fun() ->
          {ok, Value} = read_via_node(2, Key, element(1, filter_list_append())),
              TestPid ! {read_req_done, Value}
          end),
  
      % message_received -> internally seen inconsistent quorum and moved to read stage
      wait_until_notification(1),
      print_prbr_data(),
  
      %% deliver slow messages from replica 1
      ct:pal("remove slow link"),
      remove_slow_link(LinkC),
      print_prbr_data(),
  