@@ -0,0 +1,2373 @@
+package org.mapdb;%0A%0Aimport static org.junit.Assert.assertEquals;%0Aimport static org.junit.Assert.assertNotNull;%0Aimport static org.junit.Assert.fail;%0A%0Aimport java.io.File;%0Aimport java.util.Random;%0Aimport java.util.concurrent.ConcurrentMap;%0A%0Aimport org.junit.After;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.mapdb.DB;%0Aimport org.mapdb.DB.HTreeMapMaker;%0Aimport org.mapdb.DBMaker;%0Aimport org.mapdb.Hasher;%0Aimport org.mapdb.Serializer;%0A%0Apublic class Issue353Test %7B%0A%0A    private ConcurrentMap %3Cbyte%5B%5D, byte%5B%5D%3E map;%0A    private DB db;%0A    private Random random = new Random();%0A    private static final int ITERATIONS = 40000;%0A%0A    @Before%0A    public void setupDb() %7B%0A        db = DBMaker.newFileDB(UtilsTest.tempDbFile()).closeOnJvmShutdown().mmapFileEnableIfSupported()%0A                .commitFileSyncDisable().transactionDisable().compressionEnable().freeSpaceReclaimQ(0).make();%0A        HTreeMapMaker maker = db.createHashMap(%22products%22).hasher(Hasher.BYTE_ARRAY)%0A                .valueSerializer(Serializer.BYTE_ARRAY).keySerializer(Serializer.BYTE_ARRAY).counterEnable();%0A        map = maker.makeOrGet();%0A    %7D%0A%0A    @After%0A    public void shutdownDb() %7B%0A        db.close();%0A    %7D%0A%0A    @Test%0A    public void iterateKeySet() %7B%0A        db.commit();%0A        map.clear();%0A        db.commit();%0A        for (int i = 0; i %3C ITERATIONS; i++) %7B%0A            map.put(createByteArrayForKey(), createByteArrayForValue());%0A        %7D%0A        for (byte%5B%5D e : map.keySet()) %7B%0A            assertNotNull(map.get(e));%0A        %7D%0A        assertEquals(ITERATIONS, map.size());%0A        map.clear();%0A        db.commit();%0A        assertEquals(0, map.size());%0A        for (byte%5B%5D e : map.keySet()) %7B%0A            fail();%0A        %7D%0A        map.put(createByteArrayForKey(), createByteArrayForValue());%0A        db.commit();%0A        assertEquals(1, map.size());%0A        boolean found = false;%0A        for (byte%5B%5D e : map.keySet()) %7B%0A            if (found == true) %7B%0A                fail();%0A            %7D%0A            found = true;%0A        %7D%0A    %7D%0A%0A    private byte%5B%5D createByteArrayForKey() %7B%0A        byte%5B%5D result = new byte%5B12%5D;%0A        random.nextBytes(result);%0A        return result;%0A    %7D%0A%0A    private byte%5B%5D createByteArrayForValue() %7B%0A        int size = random.nextInt(300) + 200;%0A        byte%5B%5D result = new byte%5Bsize%5D;%0A        random.nextBytes(result);%0A        return result;%0A    %7D%0A%0A%7D

Add test case for #353