@@ -0,0 +1,1546 @@
+package brown.tracingplane.baggageprotocol;%0A%0Aimport static org.junit.Assert.assertEquals;%0Aimport java.nio.ByteBuffer;%0Aimport org.junit.Test;%0Aimport brown.tracingplane.atomlayer.Lexicographic;%0A%0Apublic class TestBagKey %7B%0A%0A    @Test%0A    public void testBagKeyComparison() %7B%0A        int%5B%5D indicesToTest =%0A                %7B Integer.MIN_VALUE, Short.MIN_VALUE, -10, -3, -1, 0, 1, 3, 10, Short.MAX_VALUE, Integer.MAX_VALUE %7D;%0A        String%5B%5D keysToTest = %7B %22%22, %22a%22, %22aaaaa%22, %22hello%22, %22hell%22, %22boo%22 %7D;%0A        ByteBuffer%5B%5D bufs = new ByteBuffer%5BkeysToTest.length%5D;%0A        for (int i = 0; i %3C keysToTest.length; i++) %7B%0A            bufs%5Bi%5D = ByteBuffer.wrap(keysToTest%5Bi%5D.getBytes());%0A        %7D%0A%0A        for (int i : indicesToTest) %7B%0A            for (int j : indicesToTest) %7B%0A                assertEquals(Integer.compare(i, j), BagKey.indexed(i).compareTo(BagKey.indexed(j)));%0A            %7D%0A            for (String key : keysToTest) %7B%0A                assertEquals(-1, BagKey.indexed(i).compareTo(BagKey.named(key)));%0A                assertEquals(1, BagKey.named(key).compareTo(BagKey.indexed(i)));%0A            %7D%0A            for (ByteBuffer buf : bufs) %7B%0A                assertEquals(-1, BagKey.indexed(i).compareTo(BagKey.keyed(buf)));%0A                assertEquals(1, BagKey.keyed(buf).compareTo(BagKey.indexed(i)));%0A            %7D%0A        %7D%0A%0A        for (ByteBuffer a : bufs) %7B%0A            for (ByteBuffer b : bufs) %7B%0A                assertEquals(Lexicographic.compare(a, b), BagKey.keyed(a).compareTo(BagKey.keyed(b)));%0A            %7D%0A        %7D%0A    %7D%0A%0A%7D%0A

Add another test case