anchor.diff:      gen_server:call(?SERVER, {iterator, FullPrefix, KeyMatch}, infinity).
   
   
  -%% @doc advance the iterator by one key
  +%% @doc advance the iterator by one key, full-prefix or sub-prefix
   -spec iterate(metadata_iterator()) -> metadata_iterator().
   iterate(Iterator) ->
       gen_server:call(?SERVER, {iterate, Iterator}, infinity).
   
  -%% @doc return the full prefix being iterated by this iterator
  --spec iterator_prefix(metadata_iterator()) -> metadata_prefix().
  +%% @doc return the full-prefix or prefix being iterated by this iterator. If the iterator is a
  +%% full-prefix iterator undefined is returned.
  +-spec iterator_prefix(metadata_iterator()) -> metadata_prefix() | undefined | binary() | atom().
  +iterator_prefix(#metadata_iterator{prefix=undefined,match=undefined}) -> undefined;
  +iterator_prefix(#metadata_iterator{prefix=undefined,match=Prefix}) -> Prefix;
   iterator_prefix(#metadata_iterator{prefix=Prefix}) -> Prefix.
   
  -%% @doc return the key and object pointed to by the iterator
  --spec iterator_value(metadata_iterator()) -> {metadata_key(), metadata_object()}.
  +%% @doc return the key and object or the prefix pointed to by the iterator
  +-spec iterator_value(metadata_iterator()) -> {metadata_key(), metadata_object()} | metadata_prefix().
  +iterator_value(#metadata_iterator{prefix=undefined,match=undefined,pos=Pos}) -> Pos;
   iterator_value(#metadata_iterator{obj=Obj}) -> Obj.
   
  -%% @doc returns true if there are no more keys to iterate over
  +%% @doc returns true if there are no more keys or prefixes to iterate over
   -spec iterator_done(metadata_iterator()) -> boolean().
   iterator_done(#metadata_iterator{done=Done}) -> Done.
   
  
positive.code:     It#metadata_iterator{done=true,
                           pos=undefined,
                           obj=undefined};
  next_iterator(It, {[Next], Cont}) ->
      It#metadata_iterator{pos=Cont,
                           obj=Next}.
  
negative.code: %%%===================================================================
  %%% Internal functions
  %%%===================================================================
  iterator(undefined, KeyMatch, #state{ets_tabs=Tab}) ->
      new_iterator(undefined, KeyMatch, Tab);
  iterator(FullPrefix, KeyMatch, State) ->
      case ets_tab(FullPrefix, State) of
          undefined -> empty_iterator(FullPrefix, KeyMatch, undefined);
  