anchor.diff:      MsgHistory = Endpoint#endpoint.msg_history,
       HistoryEnabled = Endpoint#endpoint.history_enabled,
       NewHistory = case HistoryEnabled of
  -                     true -> append_to_history(Data, MsgHistory);
  -                     false -> MsgHistory
  -                 end,
  +        true -> append_to_history(Data, MsgHistory);
  +        false -> MsgHistory
  +    end,
       NewEndpoint = Endpoint#endpoint{
           msg_count_per_msg = dict:update(Data, fun(Old) ->
               Old + 1 end, 1, MsgCountPerMsg),
  
positive.code: 
  handle_call({tcp_server_connection_count, Port}, _From, State) ->
      Reply = case get_endpoint(Port, State) of
                  undefined ->
                      {error, wrong_endpoint};
                  Endpoint ->
                      {ok, length(Endpoint#endpoint.connections)}
              end,
      {reply, Reply, State};
  
  handle_call(_Request, _From, State) ->
  
negative.code: 
  handle_call({tcp_server_specific_message_count, Port, Data}, _From, State) ->
      Reply = case get_endpoint(Port, State) of
          undefined ->
              {error, wrong_endpoint};
          Endpoint ->
              case dict:find(Data, Endpoint#endpoint.msg_count_per_msg) of
                  {ok, Count} ->
                      {ok, Count};
                  error ->
                      {ok, 0}
              end
  
      end,
      {reply, Reply, State};
  
  handle_call({tcp_server_all_messages_count, Port}, _From, State) ->
      Reply = case get_endpoint(Port, State) of
          undefined ->
              {error, wrong_endpoint};
          Endpoint ->
              {ok, Endpoint#endpoint.msg_count}
      end,
      {reply, Reply, State};
  
  handle_call({tcp_server_send, Port, Data, Count}, _From, State) ->
      Reply = case get_endpoint(Port, State) of
          undefined ->
              {error, wrong_endpoint};
          Endpoint ->
              Timeout = ?SEND_TIMEOUT_BASE + Count * ?SEND_TIMEOUT_PER_MSG,
              Result = utils:pmap(
                  fun(Pid) ->
                      Pid ! {self(), send, Data, Count},
                      receive
                          {Pid, ok} -> ok
                      after
                          Timeout -> error
                      end
                  end, Endpoint#endpoint.connections),
              % If all pids reported back, sending succeded
              case lists:duplicate(length(Result), ok) of
                  Result ->
                      true;
                  SomethingElse ->
                      ?error("failed_to_send_data: ~p", [SomethingElse]),
                      {error, failed_to_send_data}
              end
      end,
      {reply, Reply, State};
  
  handle_call({tcp_mock_history, Port}, _From, State) ->
      Reply = case get_endpoint(Port, State) of
          undefined ->
              {error, wrong_endpoint};
          Endpoint ->
              case Endpoint#endpoint.history_enabled of
                  false ->
                      {error, counter_mode};
                  true ->
                      {ok, get_history(Endpoint#endpoint.msg_history)}
              end
      end,
      {reply, Reply, State};
  
  handle_call(reset_tcp_mock_history, _From, State) ->
  