@@ -0,0 +1,2110 @@
+package net.openhft.chronicle.map;%0A%0Aimport net.openhft.chronicle.core.values.LongValue;%0Aimport net.openhft.chronicle.values.Values;%0Aimport org.junit.Assert;%0Aimport org.junit.Test;%0Aimport shaded.org.apache.commons.codec.binary.Hex;%0A%0Aimport java.io.File;%0A%0Apublic class LostKeyTest %7B%0A%0A    // See https://github.com/OpenHFT/Chronicle-Map/issues/233%0A    @Test%0A    public void lostkeysTest() throws Exception %7B%0A%0A        File storagetmp = new File(%22./tmp.dat%22);%0A        if (storagetmp.exists()) %7B%0A            storagetmp.delete();%0A        %7D%0A        storagetmp.deleteOnExit();%0A        try %7B%0A            LongValue valueSample = Values.newHeapInstance(LongValue.class);%0A            ChronicleMap%3Cbyte%5B%5D, LongValue%3E mmap = ChronicleMap%0A                    .of(byte%5B%5D.class, LongValue.class)%0A                    .entries(10)%0A                    .actualSegments(1)%0A                    .constantValueSizeBySample(valueSample)%0A                    .constantKeySizeBySample(new byte%5B36%5D)%0A                    .removeReturnsNull(false)%0A                    .createPersistedTo(storagetmp);%0A%0A            valueSample.setValue(1);%0A            String lostKey = %2212b5633bad1f9c167d523ad1aa1947b2732a865bf5414eab2f9e5ae5d5c191ba00000001%22;%0A%0A            byte%5B%5D h1add = Hex.decodeHex(%22591e91f809d716912ca1d4a9295e70c3e78bab077683f79350f101da6458807300000000%22);%0A            mmap.put(h1add, valueSample);%0A%0A            byte%5B%5D bLostKey = Hex.decodeHex(lostKey);%0A            mmap.put(bLostKey, valueSample);%0A%0A            LongValue v1 = mmap.remove(h1add);%0A            Assert.assertEquals(1L, v1.getValue());%0A%0A            byte%5B%5D h3add = Hex.decodeHex(%226f80ca7441710cf0942cf99e3e8aa59d38d73b124730306afeb1aec8f08fd76b00000000%22);%0A            mmap.put(h3add, valueSample);%0A            //here we lost key%0A            LongValue lostKeyVal = mmap.get(bLostKey);%0A            Assert.assertEquals(1L, lostKeyVal.getValue());%0A%0A            LongValue v2 = mmap.remove(bLostKey);%0A            Assert.assertEquals(1L, v2.getValue());%0A        %7D finally %7B%0A            if (storagetmp.exists()) %7B%0A                storagetmp.delete();%0A            %7D%0A        %7D%0A    %7D%0A%0A%7D%0A

Add test, Fix #233