anchor.diff:              verify_communication(Node, Endpoint, Remaining, ForbiddenChanges, Request + 1, ?ALLOWED_FAILURES)
       end.
   
  -space_msg(SpaceDoc) ->
  -    #document{key = ID, value = #space{name = Name, groups = Groups, users = Users}} = SpaceDoc,
  +as_changes(Docs) ->
  +    lists:map(fun as_change/1, Docs).
  +
  +as_change(#document{key = ID, value = #space{name = Name, groups = Groups, users = Users}}) ->
       {<<"space">>, [{<<"id">>, ID}, {<<"name">>, Name}, {<<"groups">>, Groups}, {<<"users">>, Users}]}.
   
   mock_capture(Node, Args) ->
  
positive.code:     Result = rest_utils:do_request(RestAddress, Headers, post, Data, Options),
      ?assertEqual(204, rest_utils:get_response_status(Result)).
  
  await_communication(Node, Endpoint, ExpectedChange) ->
      verify_communication(Node, Endpoint, [ExpectedChange], [], 1, ?ALLOWED_FAILURES).
  
  verify_communication(Node, Endpoint, ExpectedChanges, ForbiddenChanges) ->
      verify_communication(Node, Endpoint, ExpectedChanges, ForbiddenChanges, 1, ?ALLOWED_FAILURES).
  
  verify_communication(_, _, [], _, _, _) ->
      ok;
  
negative.code:     % when
      First = getFirstSeq(Node1),
      subscribe(First, <<"endpoint1">>, SubscribeParams1),
      SpaceDoc1 = save(Node1, <<"spacekey1">>, #space{name = <<"space1">>, providers = [ProviderID1], groups = []}),
  
      await_communication(Node1, <<"endpoint1">>, SpaceDoc1),
      Later = getFirstSeq(Node1),
      subscribe(Later, <<"endpoint1">>, SubscribeParams2),
      SpaceDoc2 = save(Node1, <<"spacekey2">>, #space{name = <<"space2">>, providers = [ProviderID1], groups = []}),
  
      % then
      verify_communication(Node1, <<"endpoint1">>, [SpaceDoc1], [SpaceDoc2]),
      verify_communication(Node2, <<"endpoint1">>, [SpaceDoc2], [SpaceDoc1]),
      ok.
  
  
  