anchor.diff:  %% ===================================================================
   -ifdef(TEST).
   
  -pre_post_test() ->
  -    M = riak_dt_map:new(),
  -    {ok, M2} = riak_dt_map:update({update, [{update, {<<"s">>, riak_dt_orswot}, {add_all, [<<"a">>, <<"b">>, <<"c">>]}}]}, a, M),
  -    Context = M2,
  -    {ok, M3} = riak_dt_map:update({update, [{update, {<<"s">>, riak_dt_orswot}, {add, [<<"d">>]}}]}, a, M2),
  -    {ok, M4} = riak_dt_map:update({update, [{remove, {<<"s">>, riak_dt_orswot}}]}, a, M3),
  -    Op = {update, [{update, {<<"s">>, riak_dt_orswot}, {remove, <<"a">>}}]},
  -    {Pre, Post} = split_ops(Op),
  -    ?debugFmt("Pre ~p~n post ~p~n", [Pre,Post]),
  -    {ok, PreMerge} = riak_dt_map:update(Pre, a, Context),
  -    Local = M4,
  -    {ok, Local2} = riak_dt_map:update(Post, a, Local),
  -    PostMerge = riak_dt_map:merge(PreMerge, Local2),
  -    ?debugFmt("local ~p~n", [PostMerge]),
  -    %% Set field should be present, since it's a field update (an
  -    %% element remove) "concurrent" with field removal.
  -    %% Expect the field to be present, and it's value to be [b,c]
  -    Set = riak_dt_map:value({get, {<<"s">>, riak_dt_orswot}}, PostMerge),
  -    ?assertNot(error == Set),
  -    ?assertEqual([<<"b">>, <<"c">>], lists:sort(Set)).
  -
  -pre_post_empty_test() ->
  -    M = riak_dt_map:new(),
  -    {ok, M2} = riak_dt_map:update({update, [{update, {<<"s">>, riak_dt_orswot}, {add_all, [<<"a">>, <<"b">>, <<"c">>]}}]}, a, M),
  -    Context = M2,
  -    Op = {update, [{update, {<<"s">>, riak_dt_orswot}, {remove, <<"a">>}}]},
  -    {Pre, Post} = split_ops(Op),
  -    ?debugFmt("Pre ~p~n post ~p~n", [Pre,Post]),
  -    {ok, PreMerge} = riak_dt_map:update(Pre, a, Context),
  -    Local = M,
  -    {ok, Local2} = riak_dt_map:update(Post, a, Local),
  -    PostMerge = riak_dt_map:merge(PreMerge, Local2),
  -    ?debugFmt("local ~p~n", [PostMerge]),
  -    %% Set field should be present, since it's a field update (an
  -    %% element remove) "concurrent" with field removal.
  -    %% Expect the field to be present, and it's value to be [b,c]
  -    Set = riak_dt_map:value({get, {<<"s">>, riak_dt_orswot}}, PostMerge),
  -    ?assertNot(error == Set),
  -    ?assertEqual([<<"b">>, <<"c">>], lists:sort(Set)).
   
   -ifdef(EQC).
   -define(QC_OUT(P),
  
positive.code: 
  -define(TEST_TIME_SECONDS, 10).
  
  eqc_test_() ->
      {timeout, ?TEST_TIME_SECONDS+5, [?_assert(test_split() =:= true)]}.
  
  test_split() ->
      test_split(?TEST_TIME_SECONDS).
  
  test_split(TestTimeSeconds) ->
      eqc:quickcheck(eqc:testing_time(TestTimeSeconds, ?QC_OUT(prop_split()))).
  
  prop_split() ->
      ?FORALL(Ops, oneof([riak_dt_map:gen_op(), riak_dt_orswot:gen_op()]),
              begin
                  {Pre, Post} = split_ops(Ops),
                  AgOps = to_list(Ops),
                  ?WHENFAIL(
                     begin
                         io:format("Generated Ops ~p~n", [Ops]),
                         io:format("Split Pre ~p~n", [Pre]),
                         io:format("Split Post ~p~n", [Post])
                     end,
                     collect(with_title("operation length"), length(AgOps),
                             collect(with_title("operation depth"), depth(AgOps, 0),
                                     conjunction([
                                                  {pre, only_rem_ops(Pre)},
                                                  {post, only_add_ops(Post)}
                                                 ])))
                    )
              end).
  
  to_list({update, Ops}) ->
      Ops;
  to_list(Op) ->
      [Op].
  
  depth({update, Ops}, Depth) ->
      depth(Ops, Depth);
  depth([], Depth) ->
      Depth;
  depth([{update, {_Name, ?MAP_TYPE}, {update, Ops}}| Rest], Depth) ->
      max(depth(Ops, Depth +1), depth(Rest, Depth));
  depth([_Op | Rest], Depth) ->
      depth(Rest, Depth).
  
  only_type_ops(_TestFun, []) ->
      true;
  only_type_ops(TestFun, [Op | Rest]) ->
      case TestFun(Op) of
          false ->
              false;
          true ->
              only_type_ops(TestFun, Rest)
      end.
  
  only_add_ops({update, Ops}) ->
      only_add_ops(Ops);
  only_add_ops(Ops) ->
      only_type_ops(fun is_add_op/1, Ops).
  
  only_rem_ops({update, Ops}) ->
      only_rem_ops(Ops);
  only_rem_ops(Ops) ->
      only_type_ops(fun is_rem_op/1, Ops).
  
  is_add_op({update, {_Name, _}, {update, Ops}}) ->
      only_add_ops(Ops);
  is_add_op(Op) ->
      not is_rem_op(Op).
  
  is_rem_op({update, {_Name, _}, {update, Ops}}) ->
      only_rem_ops(Ops);
  is_rem_op({update, {_Name, _}, {remove, _E}}) ->
      true;
  is_rem_op({update, {_Name, _}, {remove_all, _Es}}) ->
      true;
  is_rem_op({remove, _Key}) ->
      true;
  is_rem_op({remove_all, _Elems}) ->
      true;
  is_rem_op({update, _Key, {remove, _Elem}}) ->
      true;
  is_rem_op(_Op) ->
      false.
  
  -endif.
  -endif.
  
negative.code:             {Meta, Record, Value}
      end.
  
  %% This uses an exported but marked INTERNAL
  %% function of `riak_object:set_contents' to preserve
  %% non-crdt sibling values and Metadata
  