anchor.diff:      ?assertEqual([Val1], value(MVREG1)),
       ?assertEqual([<<>>], value(MVREG2)).
   
  +%% Equal test
  +equal_test() ->
  +    MVReg1 = [{value1, [{actor1, 2}, {actor2, 1}]}, {value2, [{actor4, 1}, {actor3, 2}]}],
  +    MVReg2 = [{value2, [{actor4, 1}, {actor3, 2}]}, {value1, [{actor2, 1}, {actor1, 2}]}],
  +    ?assert(equal(MVReg1, MVReg2)),
  +    MVReg3 = [{value1, [{actor1, 2}, {actor2, 1}]}],
  +    ?assertNot(equal(MVReg1, MVReg3)),
  +    MVReg4 = [{value1, [{actor1, 2}, {actor2, 1}]}, {value2, [{actor4, 1}, {actor3, 2}]}, {value3, [{actor5, 2}]}],
  +    ?assertNot(equal(MVReg1, MVReg4)),
  +    MVReg5 = [{value1, [{actor1, 1}, {actor2, 1}]}, {value2, [{actor4, 1}]}],
  +    ?assertNot(equal(MVReg1, MVReg5)).
  +
  +
   %% Check if the merge_to function is working
   merge_to_test() ->
       VC = riak_dt_vclock:fresh(),
       VCA0 = riak_dt_vclock:increment(actor0, VC),
       VCA1 = riak_dt_vclock:increment(actor1, VC),
  +    %% Basic test
       MVR = merge_to([{value0, VCA0}], [{value1, VCA1}]),
  -    io:format("IOFORMAT ~w ~n", [MVR]),
  -    ?assert(equal([{value1, VCA1}, {value0,VCA0}] , MVR)).
  +    ?assert(equal([{value1, VCA1}, {value0,VCA0}] , MVR)),
  +    MVReg1 = [{value1, [{actor1, 2}, {actor2, 1}]}, {value2, [{actor4, 1}]}],
  +    MVReg2 = [{value3, [{actor2, 1}, {actor1, 2}, {actor4, 1}]}],
  +    %% Merge one to another MVReg that totally dominates it.
  +    Result1 = merge_to(MVReg1, MVReg2),
  +    ?assert(equal(Result1, MVReg2)),
  +    %% Merge one to another that do not dominate any
  +    MVReg3 = [{value4, [{actor2, 1}, {actor1, 1}]}],
  +    Result2 = merge_to(MVReg1, MVReg3),
  +    ?assert(equal(Result2,  [{value1, [{actor1, 2}, {actor2, 1}]}, {value2, [{actor4, 1}]}, {value4, [{actor2, 1}, {actor1, 1}]}])),
  +    %% Merge one to another that dominates part of the left one
  +    MVReg4 = [{value5, [{actor4, 2}]}],
  +    Result3 = merge_to(MVReg1, MVReg4),
  +    ?assert(equal(Result3,  [{value1, [{actor1, 2}, {actor2, 1}]}, {value5, [{actor4, 2}]}])).
  +    %% Merge one to another that is totally by the left one: this case is already covered by if_dominate
  +
  +if_dominate_test() ->
  +    VC1 = [[{actor1, 2}, {actor2, 3}, {actor3,2}], [{actor1,3}, {actor2,1}, {actor4,2}]],
  +    VC2 = [{actor1, 1}],
  +    %% Merge one to another MVReg that totally dominates it.
  +    ?assert(if_dominate(VC1, VC2)),
  +    VC3 = [{actor1, 2}, {actor3,1}],
  +    ?assert(if_dominate(VC1, VC3)),
  +    VC4 = [{actor3, 1}, {actor4,1}],
  +    ?assertNot(if_dominate(VC1, VC4)).
  +     
  +    
   
   basic_assign_test() ->
       MVR0 = new(),
  
positive.code:     {ok, MVRA1_1} = update({assign, value1}, actor1, MVRA1_0),
      %% Propagate a timestamp that is not compatible with the current ones
      {ok, MVRMerge1} = update({propagate, value2, VCA2}, nothing, MVRA1_1),
      ?assert(equal([value1, value2], value(MVRMerge1))),
      ?assert(equal([VCA1, VCA2], value(timestamp, MVRMerge1))),
      VCA12 = riak_dt_vclock:increment(actor2, VCA1),
      %% Propagate a timestamp that dominates all current ones
      {ok, MVRMerge2} = update({propagate, value2, VCA12}, nothing, MVRMerge1),
      ?assert(equal([value2], value(MVRMerge2))),
      ?assert(equal([VCA12], value(timestamp, MVRMerge2))),
      %% Propagate a timestamp that is dominated by the current one
      {ok, MVRMerge3} = update({propagate, value3, VCA1}, nothing, MVRMerge2),
      ?assert(equal([value2], value(MVRMerge3))),
      ?assert(equal([VCA12], value(timestamp, MVRMerge3))).
      
  %% Test if a diverged MVReg merges all timestamp after being updated.
  update_assign_diverge_test() ->
  
negative.code: value(timestamp, MVReg) ->
      [TS || {_Val, TS} <- MVReg].
  
  
  %% @doc Assign `Value' to this register. The vector clock
  %% of this register will be incremented by one for the corresponding `Actor'.
  %% In case the register has multiple diverged values, firstly a vector clock that dominates 
  %% all of them is calculated, then incrementation for `Actor' is applied. 
  %% 
  %% This kind of update is supposed to be
  %% linealizable so the operation issuer does not need to provide the
  %% vector clock it has observed.
  -spec update(mvreg_op(), term(), mvreg()) ->
                      {ok, mvreg()}.
  update({assign, Value}, Actor, MVReg) ->
      VV = incVV(MVReg, Actor),
      NewMVReg = [{Value, VV}],
      {ok, NewMVReg};
  
  %% @doc Assign a `Value' to the `mvreg()'
  %% associating the update with time `TS', if `TS' is larger than the current timestamp for 
  %% `Actor'.
  update({assign, Value, TS}, Actor, MVReg) ->
      case larger_than(TS, Actor, MVReg) of 
          true ->
              VV = incVV(MVReg, Actor),
              NewMVReg = [{Value, VV}],
  