anchor.diff:  -type monitorset() :: etorrent_monitorset:monitorset().
   
   -record(state, {
  +    torrent_id     :: pos_integer(),
       chunk_size     :: pos_integer(),
       pieces_valid   :: pieceset(),
       pieces_unknown :: pieceset(),
  
positive.code:     not_implemented.
  
  handle_info({'DOWN', _, process, Pid, _}, State) ->
      {noreply, State}.
  
  %% @private
  terminate(_Reason, _State) ->
  
negative.code: code_change(_OldVsn, State, _Extra) ->
      {ok, State}.
  
  %%
  %% Given a tree of a peers currently open requests, return a list of
  %% tuples containing the piece index, offset and length of each request.
  %%
  -spec chunk_list(gb_tree()) -> [{pos_integer(), pos_integer(), pos_integer()}].
  chunk_list(OpenReqs) ->
      [{I,O,L} || {{I,O},L} <- gb_trees:to_list(OpenReqs)].
  
  %%
  %% Given a piece index and an array of chunksets for each piece,
  %% insert a chunk into the chunkset at the piece index.
  %%
  -spec insert_chunk(pos_integer(), pos_integer(),
                     pos_integer, array()) -> array().
  insert_chunk(Piece, Offset, Length, PieceChunks) ->
      Chunks = array:get(Piece, PieceChunks),
      NewChunks = etorrent_chunkset:insert(Offset, Length, Chunks),
      array:set(Piece, NewChunks, PieceChunks).
  
  -ifdef(TEST).
  -define(chunk_server, ?MODULE).
  
  
  initial_chunk_server(ID) ->
      {ok, Pid} = ?chunk_server:start_link(ID, 1, [], [{0, 2}, {1, 2}, {2, 2}]),
  