anchor.diff:      end.
   
   %% @doc Remove duplicate ops with OpId from a list (the first param)
  -%% and return a list with only one operation with OpId
  +%%      and return a list with only one operation with OpId
   -spec remove_dup([{_,operation()}],op_id(),[{_,operation()}]) -> [{_,operation()}].
   remove_dup([], _OpId, Set2) ->
       Set2;
   remove_dup([H|T], OpId, Set2) ->
  -    {_, #operation{op_number= OpNum}} = H,
  +    {_, #operation{op_number=OpNum}} = H,
       Set3 = case OpNum /= OpId of
  -              true -> lists:append(Set2, [H]);
  -              false -> Set2
  -           end,
  +        true ->
  +            lists:append(Set2, [H]);
  +        false ->
  +            Set2
  +    end,
       remove_dup(T, OpId, Set3).
  -
   
   -ifdef(TEST).
   union_test()->
  
positive.code:                 type=Type,
                  log_id=LogId,
                  payload=Payload,
                  opid= OpId,
                  readresult=[],
                  node_ops =[]},
      {ok, prepare, SD, 0}.
  
  %% @doc Prepare the write by calculating the _preference list_.
  
negative.code: %% @doc Find operations that are in List2 but not in List1
  -spec find_diff_ops(list(),list()) -> list().
  find_diff_ops(List1, List2) ->
      lists:filter(fun(X)-> lists:member(X, List1) == false end, List2).
  
  %% @doc Make a union of operations in L1 and L2
  -spec union_ops([{_,operation()}],[{_,operation()}],[{_,operation()}]) ->
      [{_,operation()}].
  union_ops(L1, L2, []) ->
      lists:append(L1, L2);
  union_ops(L1, L2, [Op|T]) ->
      {_, #operation{op_number=OpId}} = Op,
      L3 = remove_dup(L1, OpId,[]),
      L4 = lists:append(L2, [Op]),
      union_ops(L3, L4, T).
  