anchor.diff:      %TODO: implement test
   %%     ?equals(rm_chord:merge([N8, N14, N8], [N8, N14, N8], 26), [N8, N14]),
   %%     ?equals(rm_chord:merge([N8, N14, N33], [N8, N14, N33], 26), [N33, N8, N14]),
  -    ok.
  +    
  +    %TODO: test whether a node appears in its own predecessor/successor list when merged with such a list
  +    % debug output from nodelist:merge:
  +%%     io:format("~nmerge "),
  +%%     case lists:any(fun(N) -> node:equals(N, Node1) end, Neighbors1View) of
  +%%         true -> io:format("merge_Neighbors1View~p ", [Neighbors1View]);
  +%%         false -> ok
  +%%     end,
  +%%     case lists:any(fun(N) -> node:equals(N, Node1) end, Neighbors2View) of
  +%%         true -> io:format("merge_Neighbors2View~p~n~p~n~p~n~p ", [Neighbors2View, to_list(Neighbors2), get_last_and_remove(Neighbors2View, Node1, []), get_last_and_remove(to_list(Neighbors2), Node1, [])]);
  +%%         false -> ok
  +%%     end,
  +    ok.
  +
  +%TODO: add test for add_nodes
  +    %TODO: test whether a node appears in its own predecessor/successor list when such a list is added
  +    % debug output from nodelist:add_nodes:
  +%%     io:format("~nadd "),
  +%%     case lists:any(fun(N) -> node:equals(N, Node) end, NeighborsView) of
  +%%         true -> io:format("add_NeighborsView ");
  +%%         false -> ok
  +%%     end,
  +%%     case lists:any(fun(N) -> node:equals(N, Node) end, OtherView) of
  +%%         true -> io:format("add_OtherView ");
  +%%         false -> ok
  +%%     end,
  +
  +%% @doc Tests converting neighborhood structures to node lists.
  +-spec tester_to_list(any()) -> ok.
  +tester_to_list(_Config) ->
  +    N8 = node:new(pid1,   8, 0),
  +    N14 = node:new(pid2, 14, 0),
  +    N20 = node:new(pid3, 20, 0),
  +    N33 = node:new(pid4, 33, 0),
  +    N50 = node:new(pid5, 50, 0),
  +    
  +    Neighb1 = nodelist:mk_neighborhood([N8, N14, N33, N50], N20),
  +    Neighb2 = nodelist:mk_neighborhood([N8, N14, N33, N50], N20, 3, 3),
  +    Neighb3 = nodelist:mk_neighborhood([N8, N14, N33, N50], N20, 2, 2),
  +    Neighb4 = nodelist:mk_neighborhood([N8, N14, N33, N50], N20, 1, 1),
  +    Neighb5 = nodelist:mk_neighborhood([N8, N14, N33, N50], N20, 3, 1),
  +    Neighb6 = nodelist:mk_neighborhood([N8, N14, N33, N50], N20, 3, 2),
  +    Neighb7 = nodelist:mk_neighborhood([N8, N14, N33, N50], N20, 1, 3),
  +    Neighb8 = nodelist:mk_neighborhood([N8, N14, N33, N50], N20, 2, 3),
  +    Neighb9 = nodelist:mk_neighborhood([N8, N14, N33, N50], N20, 2, 1),
  +    Neighb10 = nodelist:mk_neighborhood([N8, N14, N33, N50], N20, 1, 2),
  +    
  +    ?equals(nodelist:to_list(Neighb1), [N20, N33, N50, N8, N14]),
  +    ?equals(nodelist:to_list(Neighb2), [N20, N33, N50, N8, N14]),
  +    ?equals(nodelist:to_list(Neighb3), [N20, N33, N50, N8, N14]),
  +    ?equals(nodelist:to_list(Neighb4), [N20, N33, N14]),
  +    ?equals(nodelist:to_list(Neighb5), [N20, N33, N50, N8, N14]),
  +    ?equals(nodelist:to_list(Neighb6), [N20, N33, N50, N8, N14]),
  +    ?equals(nodelist:to_list(Neighb7), [N20, N33, N50, N8, N14]),
  +    ?equals(nodelist:to_list(Neighb8), [N20, N33, N50, N8, N14]),
  +    ?equals(nodelist:to_list(Neighb9), [N20, N33, N8, N14]),
  +    ?equals(nodelist:to_list(Neighb10), [N20, N33, N50, N14]),
  +    
  +    ok.
  +
  +%% @doc Tests updating node IDs in two node lists.
  +-spec tester_update_ids(any()) -> ok.
  +tester_update_ids(_Config) ->
  +    N8 = node:new(pid1,   8, 0),
  +    N9 = node:new(pid1,   9, 1), %N8 updated
  +    N14 = node:new(pid2, 14, 0),
  +    N20 = node:new(pid3, 20, 0),
  +    N21 = node:new(pid3, 21, 1), %N20 updated
  +    N33 = node:new(pid4, 33, 0),
  +    N50 = node:new(pid5, 50, 0),
  +
  +    ?equals(nodelist:update_ids([N8, N14, N20, N33, N50], []), {[N8, N14, N20, N33, N50], []}),
  +    ?equals(nodelist:update_ids([N8, N9, N14, N20, N33, N50], []), {[N9, N9, N14, N20, N33, N50], []}),
  +    ?equals(nodelist:update_ids([N8, N9, N14, N20, N21, N33, N50], []), {[N9, N9, N14, N21, N21, N33, N50], []}),
  +    ?equals(nodelist:update_ids([N8, N14, N20, N33], [N50]), {[N8, N14, N20, N33], [N50]}),
  +    ?equals(nodelist:update_ids([N8, N14, N20], [N33, N50]), {[N8, N14, N20], [N33, N50]}),
  +    ?equals(nodelist:update_ids([N8, N14], [N20, N33, N50]), {[N8, N14], [N20, N33, N50]}),
  +    ?equals(nodelist:update_ids([N8], [N14, N20, N33, N50]), {[N8], [N14, N20, N33, N50]}),
  +    ?equals(nodelist:update_ids([], [N8, N14, N20, N33, N50]), {[], [N8, N14, N20, N33, N50]}),
  +    ?equals(nodelist:update_ids([], [N8, N9, N14, N20, N33, N50]), {[], [N9, N9, N14, N20, N33, N50]}),
  +    ?equals(nodelist:update_ids([], [N8, N9, N14, N20, N21, N33, N50]), {[], [N9, N9, N14, N21, N21, N33, N50]}),
  +    
  +    ?equals(nodelist:update_ids([N8, N14, N20, N33, N50], [N9]), {[N9, N14, N20, N33, N50], [N9]}),
  +    ?equals(nodelist:update_ids([N8, N14, N20, N33, N50], [N8]), {[N8, N14, N20, N33, N50], [N8]}),
  +    ?equals(nodelist:update_ids([N8, N14, N20, N33, N50], [N9, N33]), {[N9, N14, N20, N33, N50], [N9, N33]}),
  +    ?equals(nodelist:update_ids([N8, N14, N20, N33, N50], [N8, N33]), {[N8, N14, N20, N33, N50], [N8, N33]}),
  +    ?equals(nodelist:update_ids([N8, N14, N20, N33, N50], [N8, N14, N20, N33, N50]), {[N8, N14, N20, N33, N50], [N8, N14, N20, N33, N50]}),
  +    ?equals(nodelist:update_ids([N8, N14, N21, N33, N50], [N9, N14, N20, N33, N50]), {[N9, N14, N21, N33, N50], [N9, N14, N21, N33, N50]}),
  +    ?equals(nodelist:update_ids([N14, N21, N33, N50], [N9, N14, N20, N33]), {[N14, N21, N33, N50], [N9, N14, N21, N33]}),
  +    ?equals(nodelist:update_ids([N14, N21, N33, N50], [N9, N14, N20, N33]), {[N14, N21, N33, N50], [N9, N14, N21, N33]}),
  +    
  +    ?equals(nodelist:update_ids([N14, N20, N33, N50], [N9, N14, N20, N21, N33]), {[N14, N21, N33, N50], [N9, N14, N21, N21, N33]}),
  +    
  +    % some tests with "unsorted" lists:
  +    ?equals(nodelist:update_ids([N50, N14, N21, N8, N33], [N33, N50, N9, N14, N20]), {[N50, N14, N21, N9, N33], [N33, N50, N9, N14, N21]}),
  +    ?equals(nodelist:update_ids([N14, N33, N50, N21], [N9, N14, N20, N33]), {[N14, N33, N50, N21], [N9, N14, N21, N33]}),
  +    ?equals(nodelist:update_ids([N14, N21, N33, N50], [N20, N9, N14, N33]), {[N14, N21, N33, N50], [N21, N9, N14, N33]}),
  +    ?equals(nodelist:update_ids([N33, N14, N20, N50], [N9, N14, N20, N21, N33]), {[N33, N14, N21, N50], [N9, N14, N21, N21, N33]}),
  +    ok.
  +
  +%% @doc Tests making removing outdated nodes from a node list.
  +-spec tester_remove_outdated(any()) -> ok.
  +tester_remove_outdated(_Config) ->
  +    Null = node:null(),
  +    N8 = node:new(pid1,   8, 0),
  +    N9 = node:new(pid1,   9, 1), %N8 updated
  +    N14 = node:new(pid2, 14, 0),
  +    N20 = node:new(pid3, 20, 0),
  +    N21 = node:new(pid3, 21, 1), %N20 updated
  +    N33 = node:new(pid4, 33, 0),
  +    N50 = node:new(pid5, 50, 0),
  +
  +    ?equals(nodelist:remove_outdated([]), []),
  +    ?equals(nodelist:remove_outdated([Null]), []),
  +    ?equals(nodelist:remove_outdated([N8]), [N8]),
  +    ?equals(nodelist:remove_outdated([N8, Null]), [N8]),
  +    ?equals(nodelist:remove_outdated([Null, N8]), [N8]),
  +    ?equals(nodelist:remove_outdated([N8, N14, N20, N33, N50]), [N8, N14, N20, N33, N50]),
  +    ?equals(nodelist:remove_outdated([N8, N14, N20, N33, N50, Null]), [N8, N14, N20, N33, N50]),
  +    ?equals(nodelist:remove_outdated([N8, N14, N20, Null, N33, N50]), [N8, N14, N20, N33, N50]),
  +    ?equals(nodelist:remove_outdated([N8, N9]), [N9]),
  +    ?equals(nodelist:remove_outdated([Null, N8, N9]), [N9]),
  +    ?equals(nodelist:remove_outdated([N8, Null, N9]), [N9]),
  +    ?equals(nodelist:remove_outdated([N8, N9, N14, N20, N33, N50]), [N9, N14, N20, N33, N50]),
  +    ?equals(nodelist:remove_outdated([N8, N9, N14, N20, N21, N33, N50]), [N9, N14, N21, N33, N50]),
  +    ?equals(nodelist:remove_outdated([N8, N9, N14, N20, N8, N21, N33, N50]), [N9, N14, N21, N33, N50]),
  +    ?equals(nodelist:remove_outdated([N8, N9, N14, N20, N21, N33, N50, N50]), [N9, N14, N21, N33, N50, N50]),
  +
  +    ?equals(nodelist:remove_outdated([], N50), []),
  +    ?equals(nodelist:remove_outdated([Null], N50), []),
  +    ?equals(nodelist:remove_outdated([N8], N50), [N8]),
  +    ?equals(nodelist:remove_outdated([N8, Null], N50), [N8]),
  +    ?equals(nodelist:remove_outdated([N8, N14, N20, N33], N50), [N8, N14, N20, N33]),
  +    ?equals(nodelist:remove_outdated([N8, N14, N20, N33, N50], N50), [N8, N14, N20, N33]),
  +    ?equals(nodelist:remove_outdated([N8, N14, N20, N33, N50, Null], N50), [N8, N14, N20, N33]),
  +    ?equals(nodelist:remove_outdated([N8, N14, N20, Null, N33, N50], N50), [N8, N14, N20, N33]),
  +    ?equals(nodelist:remove_outdated([N8, N9], N50), [N9]),
  +    ?equals(nodelist:remove_outdated([Null, N8, N9], N50), [N9]),
  +    ?equals(nodelist:remove_outdated([N8, Null, N9], N50), [N9]),
  +    ?equals(nodelist:remove_outdated([N8, N9, N14, N20, N33, N50], N50), [N9, N14, N20, N33]),
  +    ?equals(nodelist:remove_outdated([N8, N9, N14, N20, N21, N33, N50], N50), [N9, N14, N21, N33]),
  +    ?equals(nodelist:remove_outdated([N8, N9, N14, N20, N8, N21, N33, N50], N50), [N9, N14, N21, N33]),
  +    ?equals(nodelist:remove_outdated([N8, N9, N14, N20, N21, N33, N33, N50, N50], N50), [N9, N14, N21, N33, N33]),
  +    
  +    % some tests with "unsorted" lists:
  +    ?equals(nodelist:remove_outdated([N14, N8, N20, N33, N50]), [N14, N8, N20, N33, N50]),
  +    ?equals(nodelist:remove_outdated([N8, N20, N33, N14, N50, Null]), [N8, N20, N33, N14, N50]),
  +    ?equals(nodelist:remove_outdated([N8, N20, N33, N14, Null, N50]), [N8, N20, N33, N14, N50]),
  +    ?equals(nodelist:remove_outdated([N9, N8]), [N9]),
  +    ?equals(nodelist:remove_outdated([Null, N9, N8]), [N9]),
  +    ?equals(nodelist:remove_outdated([N9, Null, N8]), [N9]),
  +    ?equals(nodelist:remove_outdated([N8, N20, N33, N50, N9, N14]), [N20, N33, N50, N9, N14]),
  +    ?equals(nodelist:remove_outdated([N9, N14, N20, N8, N21, N33, N50]), [N9, N14, N21, N33, N50]),
  +    ?equals(nodelist:remove_outdated([N8, N9, N14, N20, N8, N21, N33, N50]), [N9, N14, N21, N33, N50]),
  +    ?equals(nodelist:remove_outdated([N9, N50, N14, N20, N8, N21, N33, N50]), [N9, N50, N14, N21, N33, N50]),
  +    
  +    ?equals(nodelist:remove_outdated([N14, N8, N20, N33, N50], N50), [N14, N8, N20, N33]),
  +    ?equals(nodelist:remove_outdated([N8, N20, N33, N14, N50, Null], N50), [N8, N20, N33, N14]),
  +    ?equals(nodelist:remove_outdated([N8, N20, N33, N14, Null, N50], N50), [N8, N20, N33, N14]),
  +    ?equals(nodelist:remove_outdated([N9, N8], N50), [N9]),
  +    ?equals(nodelist:remove_outdated([Null, N9, N8], N50), [N9]),
  +    ?equals(nodelist:remove_outdated([N9, Null, N8], N50), [N9]),
  +    ?equals(nodelist:remove_outdated([N8, N20, N33, N50, N9, N14], N50), [N20, N33, N9, N14]),
  +    ?equals(nodelist:remove_outdated([N9, N14, N20, N8, N21, N33, N50], N50), [N9, N14, N21, N33]),
  +    ?equals(nodelist:remove_outdated([N9, N14, N20, N8, N21, N33], N50), [N9, N14, N21, N33]),
  +    ?equals(nodelist:remove_outdated([N9, N14, N20, N8, N21, N8, N33], N50), [N9, N14, N21, N33]),
  +    ?equals(nodelist:remove_outdated([N9, N14, N20, N8, N21, N33], N50), [N9, N14, N21, N33]),
  +    ok.
  
positive.code: end_per_suite(_Config) ->
      ok.
  
  merge(_Config) ->
      N8 = node:new(pid,   8, 0),
      N14 = node:new(pid, 14, 0),
  
negative.code: -compile(export_all).
  
  -include("unittest.hrl").
  -include("scalaris.hrl").
  
  all() ->
      [tester_new, tester_mk2, tester_mk4, tester_trunc, tester_to_list,
       tester_update_ids, tester_remove_outdated, merge].
  
  suite() ->
      [
  