@@ -0,0 +1,3167 @@
+/**%0A * Copyright (c) 2008-2010, http://code.google.com/p/snakeyaml/%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage org.yaml.snakeyaml.javabeans;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.Collection;%0Aimport java.util.List;%0A%0Aimport org.yaml.snakeyaml.Yaml;%0A%0Aimport junit.framework.TestCase;%0A%0Apublic class PropOrderInfluenceWhenAliasedInGenericCollectionTest extends TestCase %7B%0A%0A    public static interface Account %7B%0A    %7D%0A%0A    public static class GeneralAccount implements Account %7B%0A        public String name = %22General%22;%0A    %7D%0A%0A    public static class SuperSaverAccount extends GeneralAccount %7B        %0A        public String name = %22SuperSaver%22;%0A    %7D%0A%0A    public static class SecretAccount implements Account %7B        %0A        public String name = %22Secret%22;%0A    %7D%0A%0A    public static class CustomerAB %7B%0A        public Collection%3CAccount%3E aAll;%0A        public Collection%3CGeneralAccount%3E bGeneral;%0A    %7D%0A%0A    public static class CustomerBA %7B%0A        public Collection%3CGeneralAccount%3E aGeneral;%0A        public Collection%3CAccount%3E bAll;%0A    %7D%0A%0A    public void testAB() %7B%0A        SuperSaverAccount supersaver = new SuperSaverAccount();%0A        SecretAccount secret = new SecretAccount();%0A        GeneralAccount generalAccount = new GeneralAccount();%0A        %0A        CustomerAB customerAB = new CustomerAB();%0A        ArrayList%3CAccount%3E all = new ArrayList%3CAccount%3E();%0A        all.add(supersaver);%0A        all.add(secret);%0A        all.add(generalAccount);%0A        ArrayList%3CGeneralAccount%3E general = new ArrayList%3CGeneralAccount%3E();%0A        general.add(generalAccount);%0A        general.add(supersaver);%0A        %0A        customerAB.aAll = all;%0A        customerAB.bGeneral = general;%0A        %0A        Yaml yaml = new Yaml();%0A        String dump = yaml.dump(customerAB);%0A        //System.out.println(dump);%0A        %0A        yaml.load(dump);%0A        %0A    %7D%0A%0A    public void testBA() %7B%0A        SuperSaverAccount supersaver = new SuperSaverAccount();%0A        SecretAccount secret = new SecretAccount();%0A        GeneralAccount generalAccount = new GeneralAccount();%0A        %0A        CustomerBA customerBA = new CustomerBA();%0A        ArrayList%3CAccount%3E all = new ArrayList%3CAccount%3E();%0A        all.add(supersaver);%0A        all.add(secret);%0A        all.add(generalAccount);%0A        ArrayList%3CGeneralAccount%3E general = new ArrayList%3CGeneralAccount%3E();%0A        general.add(generalAccount);%0A        general.add(supersaver);%0A        %0A        customerBA.aGeneral = general;%0A        customerBA.bAll = all;%0A        %0A        Yaml yaml = new Yaml();%0A        String dump = yaml.dump(customerBA);%0A        //System.out.println(dump);%0A        yaml.load(dump);%0A    %7D%0A%7D%0A

test to fail (see issue 82). Generic collections erases tags which not alway ok.