@@ -0,0 +1,1446 @@
+package com.thoughtworks.xstream.converters.reflection;%0A%0Aimport junit.framework.TestCase;%0A%0Aimport java.util.Iterator;%0Aimport java.lang.reflect.Field;%0A%0Apublic class FieldDictionaryTest extends TestCase %7B%0A%0A    private FieldDictionary fieldDictionary;%0A%0A    protected void setUp() throws Exception %7B%0A        super.setUp();%0A        fieldDictionary = new FieldDictionary();%0A    %7D%0A%0A    class SomeClass %7B%0A        private String a;%0A        private String c;%0A        private String b;%0A    %7D%0A%0A    public void testListsFieldsInClassInDefinitionOrder() %7B%0A        Iterator fields = fieldDictionary.serializableFieldsFor(SomeClass.class);%0A        assertEquals(%22a%22, ((Field)fields.next()).getName());%0A        assertEquals(%22c%22, ((Field)fields.next()).getName());%0A        assertEquals(%22b%22, ((Field)fields.next()).getName());%0A        assertFalse(%22No more fields should be present%22, fields.hasNext());%0A    %7D%0A%0A    class SpecialClass extends SomeClass %7B%0A        private String brilliant;%0A    %7D%0A%0A    public void testIncludesFieldsInSuperClasses() %7B%0A        Iterator fields = fieldDictionary.serializableFieldsFor(SpecialClass.class);%0A        assertEquals(%22brilliant%22, ((Field)fields.next()).getName());%0A        assertEquals(%22a%22, ((Field)fields.next()).getName());%0A        assertEquals(%22c%22, ((Field)fields.next()).getName());%0A        assertEquals(%22b%22, ((Field)fields.next()).getName());%0A        assertFalse(%22No more fields should be present%22, fields.hasNext());%0A    %7D%0A%7D%0A

Test that fields come out in same order they are defined.