anchor.diff:  get_mock_pid() ->
       pid_groups:find_a(?MODULE).
   
  --spec new_mock_state() -> mock_state_t().
  -new_mock_state() ->
  -    #mock_state{renewal_enabled = true,
  -                renewal_counter = 0}.
  +-spec increment_renewal_counter() -> ok.
  +increment_renewal_counter() ->
  +    erlang:put(erlang:get(renewal_counter) + 1).
   
  --spec increment_renewal_counter(mock_state_t()) -> mock_state_t().
  -increment_renewal_counter(#mock_state{renewal_counter=Counter} = MockState) ->
  -    MockState#mock_state{renewal_counter = Counter+1}.
  -
  --spec get_renewal_counter(mock_state_t()) -> non_neg_integer().
  -get_renewal_counter(#mock_state{renewal_counter=Counter}) ->
  -    Counter.
  +-spec intercept_message(comm:message(), dht_node_state:state()) ->
  +                dht_node_state:state().
  +intercept_message(Msg, State) ->
  +    Owner = erlang:get(owner),
  +    comm:send_local(Owner, {intercepted_message, Msg}),
  +    State.
  
positive.code: 
  -spec get_lease_list() -> lease_list:lease_list().
  get_lease_list() ->
      comm:send_local(get_mock_pid(), {get_lease_list, self()}),
      receive
          {get_lease_list_response, List} ->
               List
      end.
  
  
negative.code: % Message Loop
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  
  -spec on(comm:message(), dht_node_state:state()) ->
                  dht_node_state:state() | kill.
  % get renewal counter
  on({get_renewal_counter, Pid}, State) ->
      comm:send_local(Pid,
                      {get_renewal_counter_response,
                       erlang:get(renewal_counter)}),
      State;
  
  % get from dht_node_state
  on({get, Key, Pid}, State) ->
      comm:send_local(Pid,
                      {get_response,
                       dht_node_state:get(State, Key)}),
      State;
  
  % intercept l_on_cseq messages
  on(Msg, State) when element(1, Msg) =:= l_on_cseq ->
      Intercept = erlang:get(message_filter),
      if
          Intercept ->
              intercept_message(Msg, State);
          true ->
              case Msg of
                  % intercept renew
                  {l_on_cseq, renew, _OldLease, _Mode} ->
                      increment_renewal_counter(),
                      l_on_cseq:on(Msg, State);
                  _ ->
                      l_on_cseq:on(Msg, State)
              end
      end.
  
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  % Init
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  -spec init({}) -> dht_node_state:state().
  init({}) ->
      DHTNodeGrp = pid_groups:group_with(dht_node),
      pid_groups:join_as(DHTNodeGrp, ?MODULE),
      ct:log("mock_l_on_cseq running on ~w~n", [self()]),
      erlang:put(message_filter, fun(_Msg) -> false end),
      erlang:put(renewal_counter, 0),
      dht_node_state:new(rt_external_rt, rm_loop_state, dht_db).
  
  -spec start_link() -> {ok, pid()}.
  start_link() ->
      gen_component:start_link(?MODULE, fun ?MODULE:on/2, {}, [{wait_for_init}]).
  
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  % Helper
  