anchor.diff:      [?_assertEqual(Exp3, merge_metric_dir(Exp3, Exp3))
       ].
   
  +metrics_from_paths(Paths) ->
  +    lists:foldl(fun(Path, Ms) ->
  +                        Name = lists:last(Path),
  +                        Metric = #metric_file{name=Name},
  +                        update_or_insert_metric(Path, Metric, Ms)
  +                end, ?EMPTY_METRIC_DIR, Paths).
  +
  +prepare_metrics_for_remote_test_() ->
  +    BaseMetrics = metrics_from_paths([[<<"foo">>, <<"bar">>],
  +                                      [<<"foo">>, <<"ham">>],
  +                                      [<<"ham">>, <<"eggs">>]]),
  +
  +    WithLocalPid = update_or_insert_metric([<<"foo">>, <<"bar">>],
  +                                           #metric_file{name= <<"bar">>, handler={local, self()}},
  +                                           BaseMetrics),
  +
  +    [?_assertEqual(?EMPTY_METRIC_DIR, prepare_metrics_for_remote(BaseMetrics)),
  +     ?_assertNotEqual(?EMPTY_METRIC_DIR, prepare_metrics_for_remote(WithLocalPid))
  +    ].
  +
   -endif.
  
positive.code: 
  convert_to_remote(Node, #metric_file{handler={local, Pid}}=MF, Ms) ->
      Handler = {remote, node(), Pid},
      V0 = MF#metric_file{handler=Handler},
      orddict:store(Node, V0, Ms);
  
  convert_to_remote(_Node, _MetricFile, Metrics) ->
      Metrics.
  
negative.code:     ].
  
  update_or_insert_metric_test_() ->
      EmptyDir = ?EMPTY_METRIC_DIR,
      Metric = #metric_file{name= <<"test">>},
      Exp1 = #metric_dir{name= <<"bar">>, dirs=[], metrics=orddict:from_list([{<<"test">>, Metric}])},
      Exp2 = #metric_dir{name= <<"foo">>, dirs=orddict:from_list([{<<"bar">>, Exp1}]), metrics=[]},
  