anchor.diff:  % Return any of the existing StreamID
   % plus an unassgined one for testing
   streamid(#state{streams = []}) ->
  -    1;
  +%    1;
  +    elements([1,2,3]);
   streamid(#state{streams = Streams}) ->
       IDs = [X || {X,_,_} <- Streams],
       elements([lists:max(IDs)+1|IDs]).
  
positive.code:             application:start(cake),
              {History,State,Result} = run_commands(?MODULE, Cmds),
              application:stop(cake),
  %            [cake_streams_statem:cleanup(X) || {_,X,_} <- element(3,State)],
              ?WHENFAIL(
                  io:format("\n\nHistory: ~w\n\nState: ~w\n\nResult: ~w\n\n",
                  [History,State,Result]),
  
negative.code:         true ->
              S
      end;
  % all the other commands do not change the abstract state
  next_state(S, _V, _Command) ->
      S.
  
  %% define the conditions needed to be
  %% met in order for a test to pass
  %postcondition(S, {call,?MODULE,request_stream_with_size,[_Size,StreamName]}, Result) ->
  %    Stream = lists:keysearch(StreamName,2,S#state.streams),
  %    case {Stream,Result} of
  %        {{value,{StreamID,_StreamName,_Data}},{ok,<<0,ID>>}} ->
  %            StreamID =:= ID;
  %        {false,{ok,_ID}} ->
  %            true;
  %        _ ->
  %            false
  %    end;
  %postcondition(S, {call,?MODULE,append,[StreamID,_Data]}, Result) ->
  %    case lists:keymember(StreamID,1,S#state.streams) of
  %        true ->
  %            Result =:= {error,timeout};
  %        false ->
  %            Result =:= {error,closed}
  %    end;
  %postcondition(S, {call,?MODULE,simple_query,[StreamID,_Start,_End]}, Result) ->
  %    Stream = lists:keysearch(StreamID,1,S#state.streams),
  %    io:format("~nStream: ~p~n",[Stream]),
  %    io:format("Result: ~p~n~n",[Result]),
  %    true;
  %postcondition(S, {call,?MODULE,request_stream,[_Size,StreamName]}, Result) ->
  %    Stream = lists:keysearch(StreamName,2,S#state.streams),
  %    case {Stream,Result} of
  %        {{value,{StreamID,_StreamName,_Data}},{ok,<<0,ID>>}} ->
  %            StreamID =:= ID;
  %        {false,{ok,_ID}} ->
  %            true;
  %        _ ->
  %            false
  %    end;
  postcondition(S, _Command, _Result) ->
      true.
  
  %%-----------------------------------------------------------------------------
  