anchor.diff:    nodes_manager:check_start_assertions(Config),
     NodesUp = ?config(nodes, Config),
   
  +  [CCM | _] = NodesUp,
  +
  +  WriteEvent = #write_event{user_id = "1234", ans_pid = self()},
  +
  +  send_event(WriteEvent, CCM),
  +  assert_nothing_received(),
  +
  +  subscribe_for_write_events(CCM, standard),
  +  send_event(WriteEvent, CCM),
  +
  +  ?assert_received({ok, standard, _}),
  +
  +  subscribe_for_write_events(CCM, tree),
  +  send_event(WriteEvent, CCM),
  +  send_event(WriteEvent, CCM),
  +  send_event(WriteEvent, CCM),
  +
  +  ?assert_received({ok, standard, _}),
  +  ?assert_received({ok, tree, _}).
  +
  +
  +test_event_aggregation(Config) ->
  +  nodes_manager:check_start_assertions(Config),
  +  NodesUp = ?config(nodes, Config),
  +  [CCM | _] = NodesUp,
  +
  +  subscribe_for_write_events(CCM, tree, #processing_config{init_counter = 4}),
  +  WriteEvent = #write_event{user_id = "1234", ans_pid = self()},
  +
  +  repeat(3, fun() -> send_event(WriteEvent, CCM) end),
  +  assert_nothing_received(),
  +
  +  send_event(WriteEvent, CCM),
  +  ?assert_received({ok, tree, _}).
  +
  +
  +%% ====================================================================
  +%% SetUp and TearDown functions
  +%% ====================================================================
  +
  +init_per_testcase(_, Config) ->
  +  ?INIT_DIST_TEST,
  +  nodes_manager:start_deps_for_tester_node(),
  +
  +  NodesUp = nodes_manager:start_test_on_nodes(2, true),
     [CCM | WorkerNodes] = NodesUp,
  +  DBNode = nodes_manager:get_db_node(),
  +
  +  StartLog = nodes_manager:start_app_on_nodes(NodesUp, [
  +    [{node_type, ccm_test}, {dispatcher_port, 5055}, {ccm_nodes, [CCM]}, {dns_port, 1308}, {db_nodes, [DBNode]}],
  +    [{node_type, worker}, {dispatcher_port, 6666}, {ccm_nodes, [CCM]}, {dns_port, 1308}, {db_nodes, [DBNode]}]]),
  +
  +  Assertions = [{false, lists:member(error, NodesUp)}, {false, lists:member(error, StartLog)}],
  +  Res = lists:append([{nodes, NodesUp}, {assertions, Assertions}], Config),
   
     ?assertEqual(ok, rpc:call(CCM, ?MODULE, ccm_code1, [])),
     timer:sleep(500),
  
positive.code: 
  repeat(N, F) -> for(1, N, F).
  for(N, N, F) -> [F()];
  for(I, N, F) -> [F()|for(I+1, N, F)].
  
  count_answers(ToReceive) ->
    Set = sets:new(),
  
negative.code: -export([all/0, init_per_testcase/2, end_per_testcase/2]).
  all() -> [test_event_subscription, test_event_aggregation].
  
  -define(assert_received(ResponsePattern), receive
                                              ResponsePattern -> ok
                                            after 1000
                                              -> ?assert(false)
                                            end).
  
  %% @doc This is distributed test of dao_vfs:find_files.
  %% It consists of series of dao_vfs:find_files with various file_criteria and comparing result to expected values.
  %% Before testing it clears documents that may affect test and after testing it clears created documents.
  