anchor.diff:      % only add the entry if it doesn't exist yet or if it is a sticky node. If its a
       % stickynode, RM told us about a new neighbour -> if the neighbour was already added
       % as a normal node, convert it to a sticky node now.
  -    case gb_trees:lookup(node:id(Entry), get_rt_tree(RT)) =:= none orelse Type =:= sticky of
  +    case gb_trees:lookup(node:id(Entry), get_rt_tree(RT)) =:= none of
           true ->
               % change the type to 'sticky' if the node is between the neighbors of the source
               % node
  
positive.code:                 -> SpacingA =< SpacingB
              end, Spacings)
      ),
      entry_delete(entry_nodeid(FilterEntry), RT)
      .
  
  % @doc Delete an entry from the routing table
  
negative.code:     UnwrappedMessage
      .
  %% userdevguide-end rt_frtchord:unwrap_message
  
  % @doc Check that the adjacent fingers of a RT are building a ring
  -spec check_well_connectedness(RT::rt()) -> boolean().
  check_well_connectedness(RT) ->
      Nodes = [N || {_, N} <- gb_trees:to_list(get_rt_tree(RT))],
      NodeIds = lists:sort([Id || {Id, _} <- gb_trees:to_list(get_rt_tree(RT))]),
      % traverse the adjacent fingers of the nodes and add each visited node to a list
      % NOTE: each node should only be visited once
      InitVisitedNodes = ordsets:from_list([{N, false} || N <- Nodes]),
      %% check forward adjacent fingers
      Visit = fun(Visit, Current, Visited, Direction) ->
              case ordsets:is_element({Current, false}, Visited) of
                  true -> % node wasn't visited
                      AccVisited = ordsets:add_element({Current, true},
                          ordsets:del_element({Current, false}, Visited)),
                      Next = case Direction of
                          succ -> rt_get_node(adjacent_succ(Current), RT);
                          pred -> rt_get_node(adjacent_pred(Current), RT)
                      end,
                      Visit(Visit, Next, AccVisited, Direction);
                  false ->
                      Filtered = ordsets:filter(fun({_, true}) -> true; (_) -> false end,
                          Visited),
                      lists:sort([entry_nodeid(N) || {N, true} <- ordsets:to_list(Filtered)])
              end
      end,
      Succs = Visit(Visit, get_source_node(RT), InitVisitedNodes, succ),
      Preds = Visit(Visit, get_source_node(RT), InitVisitedNodes, pred),
      try
          NodeIds = Succs,
          NodeIds = Preds,
          true
      catch
          _:_ -> false
      end
      .
  