anchor.diff:                  last_ring_id :: term(),
                   supported :: [{node(), [{capability(), [mode()]}]}],
                   unknown :: [node()],
  -                negotiated :: [{capability(), mode()}],
  -                rpc_fn =
  -                    fun(Node, App, Var) ->
  -                        riak_core_util:safe_rpc(Node, application, get_env, [App, Var])
  -                    end
  +                negotiated :: [{capability(), mode()}]
                  }).
   
   -define(ETS, riak_capability_ets).
  
positive.code:                            {Cap, ResolvedAcc and Resv}
                     end, true, Registered).
  
  query_capability(Node, RPCFn, Known, Capability, DefaultSup, LegacyVar) ->
      case dict:find(Capability, Known) of
          {ok, Supported} ->
              {true, {Capability, Supported}};
          error ->
              query_capability(Node, RPCFn, Capability, DefaultSup, LegacyVar)
      end.
  
  query_capability(_, _, Capability, DefaultSup, undefined) ->
      Default = {Capability, [DefaultSup]},
      {true, Default};
  query_capability(Node, RPCFn, Capability, DefaultSup, {App, Var, Map}) ->
      Default = {Capability, [DefaultSup]},
      Result = RPCFn(Node,App, Var),
      case Result of
          {badrpc, _} ->
              {false, Default};
  
negative.code: %% negotiated capability value.
  use_legacy_mapping_when_specified_and_node_has_no_caps_test() ->
      S1 = init_state([]),
      meck:new(riak_core_util, [passthrough]),
      meck:expect(riak_core_util, safe_rpc, fun(node2, application, get_env, [riak_core, cap]) -> {ok, mapping_key} end),
      S2 = register_capability(node1, ?CAP, capability_info([x,a,c,y], y, {riak_core, cap, [{mapping_key, a}]}), S1),
      S3 = add_node(node2, [], S2),
      S4 = negotiate_capabilities(node1, ?NO_OVERRIDES, S3),
      ?assertEqual([{?CAP, a}], S4#state.negotiated),
      ?assert(meck:validate(riak_core_util)),
      meck:unload(riak_core_util).
  
  %% when the other node has capabilities, then the legacy mapping is not used.
  %% assert that riak_core_util:safe_rpc is not called.
  legacy_mapping_not_used_when_node2_has_caps_even_when_specified_test() ->
      S1 = init_state([]),
      meck:new(riak_core_util, [passthrough]),
      S2 = register_capability(node1, ?CAP, capability_info([x,a,c,y], y, {riak_core, cap, [{mapping_key, a}]}), S1),
      S3 = add_node(node2, [{?CAP, [c,y]}], S2),
      S4 = negotiate_capabilities(node1, ?NO_OVERRIDES, S3),
      ?assertEqual([{?CAP, c}], S4#state.negotiated),
      ?assert(not meck:called(riak_core_util, safe_rpc, ['_', '_', '_', '_'])),
      meck:unload(riak_core_util).
  
  %%
  basic_test() ->
  