anchor.diff:      end),
       etorrent_utils:expect(assigned),
       %% Spawn a process that aquires the chunk from endgame and marks it as fetched
  -    Pid = spawn_link(fun() ->
  +    Fetch = fun() -> spawn_link(fun() ->
           ?pending:register(pending()),
           {ok, [{0,0,1}]} = ?chunkstate:request(1, testset(), testpid()),
           ?chunkstate:fetched(0, 0, 1, self(), testpid()),
           mainpid() ! fetched,
           etorrent_utils:expect(die)
  -    end),
  +    end) end,
  +    Pid0 = Fetch(),
  +    Pid1 = Fetch(),
       etorrent_utils:expect(fetched),
       %% Expect endgame to not send out requests for the fetched chunk
       ?assertEqual({ok, assigned}, ?chunkstate:request(1, testset(), testpid())),
  -    Pid ! die, etorrent_utils:wait(Pid),
  -    etorrent_utils:ping(pending()),
  -    etorrent_utils:ping(testpid()),
  +    Pid0 ! die, etorrent_utils:wait(Pid0),
  +    etorrent_utils:ping([pending(), testpid()]),
  +    ?assertEqual({ok, assigned}, ?chunkstate:request(1, testset(), testpid())),
  +    %% Expect endgame to not send out requests if two peers have fetched the request
  +    ?assertEqual({ok, assigned}, ?chunkstate:request(1, testset(), testpid())),
  +    Pid1 ! die, etorrent_utils:wait(Pid1),
  +    etorrent_utils:ping([pending(), testpid()]),
       %% Expect endgame to send out request if the chunk is dropped before it's stored
       ?assertEqual({ok, [{0, 0, 1}]}, ?chunkstate:request(1, testset(), testpid())),
       Orig ! die, etorrent_utils:wait(Orig).
  
positive.code: -record(state, {
      active   :: boolean(),
      pending  :: pid(),
      requests :: gb_tree(),
      fetched  :: gb_tree(),
      stored   :: gb_tree()}).
  
  
negative.code:     InitState = #state{
          active=false,
          pending=Pending,
          assigned=gb_trees:empty(),
          fetched=gb_trees:empty(),
          stored=gb_sets:empty()},
      {ok, InitState}.
  