anchor.diff:      Sets = [sets:from_list(generate_unique(Card)) || _ <- lists:seq(1, NumSets)],
       Filters = lists:map(fun (S) -> insert_many(sets:to_list(S), new(14)) end,
                           Sets),
  -
  +    error_logger:info_msg("expected: ~p, estimated: ~p~n",
  +                          [sets:size(sets:union(Sets)), card(union(Filters))]),
       ?assert(abs(sets:size(sets:union(Sets)) - card(union(Filters)))
               < (Card * NumSets) * 0.1).
   
  
positive.code: 
  -spec to_json(filter()) -> any().
  to_json(Hyper) ->
      {[
        {<<"p">>, Hyper#hyper.p},
        {<<"registers">>, encode_registers(Hyper#hyper.registers)}
       ]}.
  
  -spec from_json(any()) -> filter().
  from_json({Struct}) ->
      P = proplists:get_value(<<"p">>, Struct),
      M = trunc(math:pow(2, P)),
  
      EmptyArray = array:new([{size, M}, {fixed, true}, {default, 0}]),
      {_, Registers} = lists:foldl(fun (0, {I, A}) ->
                                           {I+1, A};
                                       (V, {I, A}) ->
                                           {I+1, array:set(I, V, A)}
                                   end,
                                   {0, EmptyArray},
                                   decode_registers(
                                     proplists:get_value(<<"registers">>, Struct))),
  
      #hyper{p = P, registers = Registers}.
  
  encode_registers(Registers) ->
      ByteEncoded = array:foldl(fun (_I, V, A) ->
                                        [<<V:8/integer>> | A]
                                end, [], array:resize(Registers)),
  
      base64:encode(
        zlib:gzip(
          iolist_to_binary(
            lists:reverse(ByteEncoded)))).
  
  decode_registers(B) ->
      decode_registers(zlib:gunzip(base64:decode(B)), []).
  
  decode_registers(<<>>, Acc) ->
      lists:reverse(Acc);
  
negative.code: 
  serialization_test() ->
      Hyper = insert_many(generate_unique(10), new(14)),
  
      L = Hyper#hyper.registers,
      R = (from_json(to_json(Hyper)))#hyper.registers,
  
      ?assertEqual(trunc(card(Hyper)), trunc(card(from_json(to_json(Hyper))))),
      ?assertEqual(Hyper#hyper.p, (from_json(to_json(Hyper)))#hyper.p),
      ?assertEqual(gb_trees:to_list(L), gb_trees:to_list(R)).
  
  encoding_test() ->
      Hyper = insert_many(generate_unique(100000), new(14)),
  