anchor.diff:      ],
       [ {namespace, "com.klarna.test.bix"}
       , {doc, "Some doc"}
  +    , {aliases, ["TestRecordAlias1", "TestRecordAlias2"]}
       ]
      ).
  +
  +extracted_test_record() ->
  +  avro_record:type(
  +    "TestRecord",
  +    [ %% simple type
  +      avro_record:define_field(
  +        "field1", avro_primitive:int_type())
  +      %% huge nested type
  +    , avro_record:define_field(
  +        "field2", avro_array:type(
  +                    avro_union:type(
  +                      [ avro_primitive:string_type()
  +                      , "com.klarna.test.bix.TestSubRecord"
  +                      , "com.klarna.test.bix.MyFixed"
  +                      ])))
  +      %% named type without explicit namespace
  +    , avro_record:define_field(
  +        "field3", "com.klarna.test.bix.SomeType")
  +    ],
  +    [ {namespace, "com.klarna.test.bix"}
  +    , {doc, "Some doc"}
  +    , {aliases, ["TestRecordAlias1", "TestRecordAlias2"]}
  +    ]).
   
   extract_from_primitive_type_test() ->
     Type = avro_primitive:int_type(),
  
positive.code:     ],
      [ {namespace, "com.klarna.test.bix"}
      , {doc, "Some doc"}
      ]).
  
  test_record() ->
  
negative.code: 
  do_add_type(Type, Store) ->
    FullName = avro:get_type_fullname(Type),
    Aliases = avro:get_aliases(Type),
    do_add_type_by_names([FullName|Aliases], Type, Store).
  
  do_add_type_by_names([], _Type, Store) ->
    Store;
  do_add_type_by_names([Name|Rest], Type, Store) ->
    case get_type_from_store(Name, Store) of
      {ok, _} ->
        erlang:error({type_with_same_name_already_exists_in_store, Name});
      false   ->
        Store1 =  put_type_to_store(Name, Type, Store),
        do_add_type_by_names(Rest, Type, Store1)
    end.
  
  %% Extract all children types from the type if possible, replace extracted
  