anchor.diff:     ?assertMatch({<<16#49, 16#53, 16#c5>>, [], #context{pmap = <<2#101:3>>}}, encode([{<<"Flag">>, <<"ISE">>}], Field, Context2)).
   
   appendix_3_2_3_2_test() ->
  -   ok.
  -   % TODO:
  -   %Field = #field{type = string, presence = optional, name = <<"Flag">>, operator = #copy{dictionary = ?template_name, value = undef, key = "key"}},
  -   %Context = create_context(<<>>),
  -   %Res = {_, _, Context1} = encode([{<<"Flag">>, absent}], Field, Context),
  -   %?assertMatch({<<2#10000000:8>>, [], #context{pmap = <<1:1>>}}, Res),
  -   %Res1 = {_, _, Context2} = encode([{<<"Flag">>, absent}], Field, Context1),
  -   %?assertMatch({<<>>, [], #context{pmap = <<2#10:2>>}}, Res1).
  +   Field = #field{type = string, presence = optional, name = <<"Flag">>, operator = #copy{dictionary = ?template_name, value = undef, key = "key"}},
  +   Context = create_context(<<>>),
  +   Res1 = {_, _, Context1} = encode([{<<"Flag">>, absent}], Field, Context),
  +   ?assertMatch({<<2#10000000:8>>, [], #context{pmap = <<2#1:1>>}}, Res1),
  +   Res2 = {_, _, Context2} = encode([{<<"Flag">>, absent}], Field, Context1),
  +   ?assertMatch({<<>>, [], #context{pmap = <<2#10:2>>}}, Res2),
  +   Res3 = {_, _, _Context3} = encode([{<<"Flag">>, <<"CME">>}], Field, Context2),
  +   ?assertMatch({<<16#43, 16#4d, 16#c5>>, [], #context{pmap = <<2#101:3>>}}, Res3).
   
   appendix_3_2_4_1_test() ->
      Field = #field{type = uInt32, presence = mandatory, name = <<"Flag">>, operator = #increment{dictionary =
  
positive.code:       #copy{}}, _Context) when (FieldName1 =/= FieldName2) orelse ((FieldName1 == FieldName2) andalso (Value == absent)) ->
     throw({error, {'ERR D6', FieldName2, "Mandatory field can not be absent with copy operator."}});
  
  encode(MsgFields = [{FieldName1, _Value} | _], #field{name = FieldName2, presence = optional, operator = #copy{}},
        Context = #context{pmap = PMap})
     when (FieldName1 =/= FieldName2) ->
     {<<>>, MsgFields, Context#context{pmap = <<PMap/bits, 0:1>>}};
  
  encode([{FieldName1, Value} | MsgFieldsRest], #field{type = Type, name = FieldName2, presence = optional, operator = #copy{}},
        Context = #context{pmap = PMap})
     when (FieldName1 == FieldName2) andalso (Value == absent) ->
     {encode_type(Type, null, true), MsgFieldsRest, Context#context{pmap = <<PMap/bits, 1:1>>}};
  
  encode([{_, Value} | MsgFieldsRest],
     #field{type = Type, presence = Presence, operator = #copy{dictionary = D, key = Key, value = InitialValue}},
  
negative.code:    Res3 = {_, _, _Context4} = encode([{<<"Security">>, <<"RSESM6">>}], Field, Context3),
     ?assertMatch({<<16#ff, 16#52, 16#d3>>, [], #context{pmap = <<>>}}, Res3).
  
  appendix_3_2_6_3_test() ->
     Field = #field{type = decimal, presence = optional, name = <<"Value">>, operator = #decFieldOp{
           exponent = #copy{dictionary = ?template_name, key = "key_exponent"},
           mantissa = #copy{dictionary = ?template_name, key = "key_mantissa"}
        }},
     Context = create_context(<<>>),
     Res1 = {_, _, Context1} = encode([{<<"Value">>, {942755, -2}}], Field, Context),
     ?assertMatch({<<16#fe, 16#39, 16#45, 16#a3>>, [], #context{pmap = <<2#11:2>>}}, Res1),
     Res2 = {_, _, _Context2} = encode([{<<"Value">>, {942760, -2}}], Field, Context1),
     ?assertMatch({<<16#39, 16#45, 16#a8>>, [], #context{pmap = <<2#1101:4>>}}, Res2).
  
  -endif.
  