anchor.diff:                 end,
       State2 = State#state{unknown=Unknown2},
       add_node_capabilities(Node, Capabilities, State2);
  -add_node(Node, Capabilities, State1) ->
  -    State2 = add_node_capabilities(Node, Capabilities, State1),
  -    filter_removed_caps(Node, Capabilities, State2).
  -
  -%% Remove supported capabilities for a node where it no longer appears in the
  -%% rings capabilities for the node.
  -%%
  -%% This can occur when another node downgrades to a version where the capability
  -%% is not declared. We must remove it from our local copy of its supported modes
  -%% so that the default value can be used.
  -filter_removed_caps(Node, Capabilities, State1) ->
  -    NodeSupported = lists:filter(
  -        fun({CapName, _}) ->
  -            lists:keymember(CapName, 1, Capabilities)
  -        end, get_supported(Node, State1)),
  -    Supported = orddict:store(Node, NodeSupported, State1#state.supported),
  -    State1#state{ supported = Supported }.
  +add_node(Node, Capabilities, State) ->
  +    add_node_capabilities(Node, Capabilities, State).
   
   add_node_capabilities(Node, Capabilities, State) ->
       lists:foldl(fun({Capability, Supported}, StateAcc) ->
  
positive.code:                  {Member, Caps}
           end
       end || Member <- Members].
  
  
  %% Determine capabilities of legacy nodes based on app.config settings and
  %% the provided app-var -> mode mapping associated with capabilities when
  
negative.code: -ifdef(TEST).
  -include_lib("eunit/include/eunit.hrl").
  
  basic_test() ->
      S1 = init_state([]),
  
      S2 = register_capability(n1, 
                               {riak_core, test},
                               capability_info([x,a,c,y], y, []),
                               S1),
      S3 = add_node_capabilities(n2,
                                 [{{riak_core, test}, [a,b,c,y]}],
                                 S2),
      S4 = negotiate_capabilities(n1, [{riak_core, []}], S3),
      ?assertEqual([{{riak_core, test}, a}], S4#state.negotiated),
  
      S5 = negotiate_capabilities(n1,
                                  [{riak_core, [{test, [{prefer, c}]}]}],
                                  S4),
      ?assertEqual([{{riak_core, test}, c}], S5#state.negotiated),
  
      S6 = add_node_capabilities(n3,
                                 [{{riak_core, test}, [b]}],
                                 S5),
      S7 = negotiate_capabilities(n1, [{riak_core, []}], S6),
      ?assertEqual([{{riak_core, test}, y}], S7#state.negotiated),
  
      S8 = negotiate_capabilities(n1,
                                  [{riak_core, [{test, [{use, x}]}]}],
                                  S7),
      ?assertEqual([{{riak_core, test}, x}], S8#state.negotiated),
      ok.
  
  -endif.
  