anchor.diff:  %% to LevelDB using a single batch write. Writes are flushed whenever the
   %% buffer becomes full, as well as before updating the hashtree.
   %%
  -%% Tree exchange is provided by the ``compare/2'' and ``compare/3'' functions.
  -%% The behavior of these functions is determined through a provided function
  +%% Tree exchange is provided by the ``compare/4'' function.
  +%% The behavior of this function is determined through a provided function
   %% that implements logic to get buckets and segments for a given remote tree,
   %% as well as a callback invoked as key differences are determined. This
   %% generic interface allows for tree exchange to be implemented in a variety
   %% of ways, including directly against to local hash tree instances, over
   %% distributed Erlang, or over a custom protocol over a TCP socket. See
  -%% ``local_compare/2'' and ``do_remote/1'' for examples.
  +%% ``local_compare/2'' and ``do_remote/1'' for examples (-ifdef(TEST) only).
   
   -module(hashtree).
   
  
positive.code:          width/1,
           mem_levels/1]).
  
  -export([run_local/0,
           run_local/1,
           run_concurrent_build/0,
  
negative.code: %%% EUnit
  %%%===================================================================
  
  -spec local_compare(hashtree(), hashtree()) -> [keydiff()].
  local_compare(T1, T2) ->
      Remote = fun(get_bucket, {L, B}) ->
                       get_bucket(L, B, T2);
                  (key_hashes, Segment) ->
                       [{_, KeyHashes2}] = key_hashes(T2, Segment),
                       KeyHashes2
               end,
      compare(T1, Remote).
  
  -spec compare(hashtree(), remote_fun()) -> [keydiff()].
  compare(Tree, Remote) ->
      compare(Tree, Remote, fun(Keys, KeyAcc) ->
                                    Keys ++ KeyAcc
                            end).
  
  -spec compare(hashtree(), remote_fun(), acc_fun(X)) -> X.
  compare(Tree, Remote, AccFun) ->
      compare(Tree, Remote, AccFun, []).
  
  %% Verify that `update_tree/1' generates a snapshot of the underlying
  %% LevelDB store that is used by `compare', therefore isolating the
  