@@ -0,0 +1,1554 @@
+package io.undertow.util;%0A%0Aimport java.lang.reflect.Field;%0Aimport java.util.ArrayList;%0Aimport java.util.Collections;%0Aimport java.util.Comparator;%0Aimport java.util.List;%0A%0Aimport junit.framework.Assert;%0Aimport org.junit.Test;%0A%0A/**%0A * Tests that the headers in the Headers class have the correct order. The headers%0A * are assigned an explicit ordering integer to allow for super fast comparisons.%0A *%0A * @author Stuart Douglas%0A */%0Apublic class HeaderOrderTestCase %7B%0A%0A    @Test%0A    public void testHeadersOrder() throws Exception %7B%0A%0A        final Field orderIntField = HttpString.class.getDeclaredField(%22orderInt%22);%0A        orderIntField.setAccessible(true);%0A%0A        Field%5B%5D fields = Headers.class.getDeclaredFields();%0A        final List%3CHttpString%3E headers = new ArrayList%3C%3E();%0A        for(final Field field : fields) %7B%0A            Object value = field.get(null);%0A            if(!(value instanceof HttpString)) %7B%0A                continue;%0A            %7D%0A            HttpString header = (HttpString) value;%0A            if((int)orderIntField.get(header) != 0) %7B%0A                headers.add(header);%0A            %7D%0A        %7D%0A%0A        Collections.sort(headers, new Comparator%3CHttpString%3E() %7B%0A            @Override%0A            public int compare(final HttpString o1, final HttpString o2) %7B%0A                return o1.toString().toLowerCase().compareTo(o2.toString().toLowerCase());%0A            %7D%0A        %7D);%0A        int val = 1;%0A        for(final HttpString header : headers) %7B%0A            Assert.assertEquals(val++, orderIntField.get(header));%0A        %7D%0A%0A    %7D%0A%0A%7D%0A

Add test for header ordering