anchor.diff:      P3 = dict:store(8,[3,9,10],P2),
       P4 = dict:store(9,[4,5,8],P3),
       P5 = dict:store(10,[7,8],P4),
  -    Groups = dict:store(3, [0,1,3], dict:new()),
  -    ?assertEqual(true, interested(0, 3, 6, #state{groups=Groups, nleaves=6, paths=P5})),
  -    ?assertEqual(false, interested(2, 3, 7, #state{groups=Groups, nleaves=6, paths=P5})),
  -    ?assertEqual(true, interested(7, 3, 10, #state{groups=Groups, nleaves=6, paths=P5})),
  -    ?assertEqual(false, interested(9, 3, 8, #state{groups=Groups, nleaves=6, paths=P5})).
  -    
  +    Groups = ets:new(test, [set, named_table]),
  +    true = ets:insert(Groups, {3, [0,1,3]}),
  +    ?assertEqual(true, interested(0, 3, 6, Groups, 6, P5)),
  +    ?assertEqual(false, interested(2, 3, 7, Groups, 6, P5)),
  +    ?assertEqual(true, interested(7, 3, 10, Groups, 6, P5)),
  +    ?assertEqual(false, interested(9, 3, 8, Groups, 6, P5)),
  +    true = ets:delete(Groups).
   
   expand_links_test() ->
       P1 = dict:store(6,[0,1,7],dict:new()),
  
positive.code:                           end, [], Stream0),
      {reply, {ok, Stream1, Internal}, S0};
  
  handle_call({filter_stream_leaf, Stream0}, _From, S0=#state{tree=Tree, nleaves=NLeaves, myid=MyId, map=Map}) ->
      Row = dict:fetch(MyId, Tree),
      Internal = find_internal(Row, 0, NLeaves),
      Stream1 = lists:foldl(fun({BKey, Elem}, Acc) ->
                              {Bucket, _Key} = BKey,
                              case interested(Internal, Bucket, MyId, S0) of
                                  true ->
                                      Acc ++ [Elem];
                                  false ->
  
negative.code:                     {reply, {error, no_replica_found}, S0};
                  _ ->
                      {reply, {ok, ClosestId}, S0}
              end
      end;
  
  
  handle_call({get_datanodes_ids, BKey}, _From, S0=#state{groups=Groups, myid=MyId}) ->
      {Bucket, _Key} = BKey,
      case ets:lookup(Groups, Bucket) of
          [] ->
              {reply, {error, unknown_key}, S0};
          [{Bucket, Value}] ->
              Group = lists:foldl(fun(Id, Acc) ->
                                      case Id of
                                          MyId ->
  