@@ -0,0 +1,1824 @@
+package me.lemire.integercompression;%0A%0Aimport java.util.Arrays;%0A%0Aimport org.junit.Test;%0Aimport static org.junit.Assert.*;%0A%0Apublic class BoundaryTest%0A%7B%0A    private IntegratedComposition newComposition() %7B%0A        return new IntegratedComposition(%0A                new IntegratedBinaryPacking(),%0A                new IntegratedVariableByte());%0A    %7D%0A%0A    private void compressAndUncompress(int length, IntegratedComposition c)%0A        throws Exception%0A    %7B%0A        // Initialize array.%0A        int%5B%5D source = new int%5Blength%5D;%0A        for (int i = 0; i %3C source.length; ++i) %7B%0A            source%5Bi%5D = i;%0A        %7D%0A%0A        // Compress an array.%0A        int%5B%5D compressed = new int%5Blength%5D;%0A        IntWrapper c_inpos = new IntWrapper(0);%0A        IntWrapper c_outpos = new IntWrapper(0);%0A        c.compress(source, c_inpos, source.length, compressed, c_outpos);%0A        assertTrue(c_outpos.get() %3C= length);%0A%0A        // Uncompress an array.%0A        int%5B%5D uncompressed = new int%5Blength%5D;%0A        IntWrapper u_inpos = new IntWrapper(0);%0A        IntWrapper u_outpos = new IntWrapper(0);%0A        c.uncompress(compressed, u_inpos, c_outpos.get(),%0A                uncompressed, u_outpos);%0A%0A        // Compare between uncompressed and original arrays.%0A        int%5B%5D target = Arrays.copyOf(uncompressed, u_outpos.get());%0A        assertArrayEquals(source, target);%0A    %7D%0A%0A    @Test%0A    public void around128() throws Exception %7B%0A        IntegratedComposition c = newComposition();%0A        compressAndUncompress(127, c);%0A        compressAndUncompress(128, c);%0A        compressAndUncompress(129, c);%0A    %7D%0A%0A    @Test%0A    public void around256() throws Exception %7B%0A        IntegratedComposition c = newComposition();%0A        compressAndUncompress(255, c);%0A        compressAndUncompress(255, c);%0A        compressAndUncompress(257, c);%0A    %7D%0A%7D%0A

test to check boudary of length, which failed