@@ -0,0 +1,1398 @@
+package org.mapdb.issues;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.Collections;%0Aimport java.util.Comparator;%0Aimport java.util.Iterator;%0Aimport java.util.List;%0A%0Aimport org.junit.Test;%0Aimport org.mapdb.BTreeKeySerializer;%0Aimport org.mapdb.DB;%0Aimport org.mapdb.DBMaker;%0Aimport org.mapdb.Fun;%0Aimport org.mapdb.Pump;%0A%0Apublic class Issue582Test %7B%0A%0A    @Test%0A    public void test()%7B%0A        // make the features%0A%0A        List%3CFun.Pair%3CString, Integer%3E%3E features = new ArrayList%3CFun.Pair%3CString, Integer%3E%3E();%0A        for (int i = 0 ; i %3C 6061 ; i++) %7B%0A            features.add(new Fun.Pair%3CString, Integer%3E(%22job_geomerror.%22 + i, (Integer) i));%0A        %7D%0A%0A        DB db = DBMaker.newTempFileDB().make();%0A%0A        Iterator%3CFun.Pair%3CString,Integer%3E%3E iter = Pump.sort(features.iterator(),%0A                true, 100000,%0A                Collections.reverseOrder(new Comparator%3CFun.Pair%3CString,Integer%3E%3E() %7B%0A                    @Override%0A                    public int compare(Fun.Pair%3CString,Integer%3E o1, Fun.Pair%3CString,Integer%3E o2) %7B%0A                        return o1.compareTo(o2);%0A                    %7D%0A                %7D),%0A                db.getDefaultSerializer(),%0A                null%0A                );%0A%0A        db.createTreeMap(%22test%22)%0A        .pumpSource(iter)%0A        // removing this line causes everything to work fine%0A        .keySerializer(BTreeKeySerializer.STRING)%0A        .make();%0A%0A    %7D%0A%7D%0A

test case for issue 582