anchor.diff:      [?_assertEqual(10, gcd(10, 0)),
        ?_assertEqual(5, gcd(0, 5)),
        ?_assertEqual(5, gcd(10, 5))
  +    ].
  +
  +consolidate_test_() ->
  +    Series = pseudo_series([1,2,1,2,1,2,1,5]),
  +    Expected = pseudo_series([1.5,1.5,1.5,3.0], 20),
  +    [?_assertEqual(Expected, consolidate(Series, 2)),
  +     ?_assertEqual(pseudo_series([1.5], 30), consolidate(pseudo_series([1, null, 2]), 3)),
  +     ?_assertEqual(pseudo_series([1.5, 1.0], 30), consolidate(pseudo_series([1, null, 2, null, null, 1]), 3)),
  +     ?_assertEqual(pseudo_series([], 20), consolidate(pseudo_series([]), 2))
       ].
   
   percentile_test_() ->
  
positive.code:     end.
  
  
  safe_minimum([]) -> null;
  safe_minimum(Values) ->
      safe_minimum(Values, null).
  
negative.code:     ].
  
  average_above_test_() ->
      Series = [pseudo_series([5.0, 7.0])],
      [?_assertEqual(Series, evaluate_call(<<"averageAbove">>, [Series, 6.0], 0, 0, 0)),
       ?_assertEqual([], evaluate_call(<<"averageAbove">>, [Series, 6.5], 0, 0, 0))
      ].
  
  average_below_test_() ->
      Series = [pseudo_series([5.0, 7.0])],
      [?_assertEqual([], evaluate_call(<<"averageBelow">>, [Series, 5.5], 0, 0, 0)),
       ?_assertEqual(Series, evaluate_call(<<"averageBelow">>, [Series, 6.0], 0, 0, 0)),
       ?_assertEqual(Series, evaluate_call(<<"averageBelow">>, [Series, 10], 0, 0, 0))
      ].
  
  npercentile_test_() ->
      Series = [pseudo_series([5.0, 8.0, 7.0])],
      [?_assertEqual([pseudo_series([7.0, 7.0, 7.0])], evaluate_call(<<"nPercentile">>, [Series, 50], 0, 0, 0)),
       ?_assertEqual([pseudo_series([5.0, 5.0, 5.0])], evaluate_call(<<"nPercentile">>, [Series, 10], 0, 0, 0)),
       ?_assertEqual([pseudo_series([8.0, 8.0, 8.0])], evaluate_call(<<"nPercentile">>, [Series, 99], 0, 0, 0))
      ].
  
  average_outside_percentile_test_() ->
      S1 = [pseudo_series([3.0, 5.0, 4.0])], % avg 4.0
      S2 = [pseudo_series([3.0, 9.0, 6.0])], % avg 6.0
      S3 = [pseudo_series([3.0, 12.0, 9.0])], % avg 8.0
      Series = S1 ++ S2 ++ S3,
      [?_assertEqual(S1 ++ S3, evaluate_call(<<"averageOutsidePercentile">>, [Series, 80], 0, 0, 0)),
       ?_assertEqual(Series, evaluate_call(<<"averageOutsidePercentile">>, [Series, 50], 0, 0, 0))
      ].
  
  most_deviant_test_() ->
      S1 = [pseudo_series([3.0, 5.0, 4.0])], % avg 4.0
      S2 = [pseudo_series([3.0, 9.0, 6.0])], % avg 6.0
      S3 = [pseudo_series([3.0, 12.0, 9.0])], % avg 8.0
      Series = S1 ++ S2 ++ S3,
      [?_assertEqual(Series, evaluate_call(<<"mostDeviant">>, [Series, 3], 0, 0, 0)),
       ?_assertEqual(Series, evaluate_call(<<"mostDeviant">>, [Series, 90], 0, 0, 0)),
  