@@ -0,0 +1,1624 @@
+%0A/*%0A * Copyright (C) 2015 Archie L. Cobbs. All rights reserved.%0A */%0A%0Apackage org.jsimpledb;%0A%0Aimport java.util.NavigableSet;%0Aimport java.util.UUID;%0A%0Aimport org.jsimpledb.annotation.JField;%0Aimport org.jsimpledb.annotation.JSimpleClass;%0Aimport org.jsimpledb.core.ObjId;%0Aimport org.jsimpledb.index.Index;%0Aimport org.jsimpledb.test.TestSupport;%0Aimport org.jsimpledb.util.NavigableSets;%0Aimport org.testng.annotations.Test;%0A%0Apublic class IndexQuerySetsTest extends TestSupport %7B%0A%0A    @Test%0A    @SuppressWarnings(%22unchecked%22)%0A    public void testNavigableSets() throws Exception %7B%0A%0A        final JSimpleDB jdb = BasicTest.getJSimpleDB(Foo.class);%0A%0A        final JTransaction jtx = jdb.createTransaction(true, ValidationMode.MANUAL);%0A        JTransaction.setCurrent(jtx);%0A        try %7B%0A%0A            final Foo f1 = jtx.create(Foo.class);%0A            f1.setUUID(UUID.randomUUID());%0A%0A            final NavigableSet%3CFoo%3E foos = jtx.queryIndex(Foo.class, %22UUID%22, UUID.class).asMap().get(f1.getUUID());%0A%0A            NavigableSets.%3CFoo%3Eunion(foos, NavigableSets.%3CFoo%3Eempty());%0A            NavigableSets.%3CFoo%3Eunion(NavigableSets.%3CFoo%3Eempty(), foos);%0A%0A            NavigableSets.%3CFoo%3Eintersection(foos, NavigableSets.%3CFoo%3Eempty());%0A            NavigableSets.%3CFoo%3Eintersection(NavigableSets.%3CFoo%3Eempty(), foos);%0A%0A            jtx.commit();%0A%0A        %7D finally %7B%0A            JTransaction.setCurrent(null);%0A        %7D%0A    %7D%0A%0A// Model Classes%0A%0A    @JSimpleClass%0A    public abstract static class Foo implements JObject %7B%0A%0A        @JField(indexed = true)%0A        public abstract UUID getUUID();%0A        public abstract void setUUID(UUID uuid);%0A    %7D%0A%7D%0A

Add a unit test exhibiting a bug in NavigableSets.union().