anchor.diff:  % private API for unit tests:
   -export([find_smallest_interval/1, merge_interval/2]).
   
  +-include("scalaris.hrl").
   -include("record_helpers.hrl").
   
   -type data_item() :: {float(), pos_integer()}.
  
positive.code: %% @doc Merges the given two histograms by adding every data point of Hist2
  %%      to Hist1.
  -spec merge(Hist1::histogram(), Hist2::histogram()) -> histogram().
  merge(Hist1 = #histogram{data = Hist1Data}, #histogram{data = Hist2Data}) ->
      NewData = lists:foldl(fun insert/2, Hist1Data, Hist2Data),
      resize(Hist1#histogram{data = NewData, data_size = length(NewData)}).
  
negative.code: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  -spec resize(Histogram::histogram()) -> histogram().
  resize(Histogram = #histogram{data = Data, size = ExpectedSize, data_size = ActualSize}) ->
      ?ASSERT(ExpectedSize > 0),
      if
          (ActualSize > ExpectedSize) andalso (1 < ActualSize) ->
              %% we need at least two items to do the following:
              MinSecondValue = find_smallest_interval(Data),
              NewHistogram = Histogram#histogram{data = merge_interval(MinSecondValue, Data),
  