public static Mode compressionMode(int min, int max) {
        if (min >= 0 && max < 1 << 30) return Mode.COMPRESSED_POSITIVE;
        if (min > -1 << 29 && max < 1 << 29) return Mode.COMPRESSED;
        return Mode.NONE;
    }
@Test
    public void testMode() {
        assertEquals(Mode.NONE,                IntegerCompressor.compressionMode(-0x80000000,  0x00000000));
        assertEquals(Mode.NONE,                IntegerCompressor.compressionMode(-0x20000000,  0x00000000));
        assertEquals(Mode.NONE,                IntegerCompressor.compressionMode(-0x00000001,  0x3fffffff));
        assertEquals(Mode.COMPRESSED,          IntegerCompressor.compressionMode(-0x1fffffff,  0x1fffffff));
        assertEquals(Mode.COMPRESSED,          IntegerCompressor.compressionMode(-0x1fffffff, -0x1fffffff));
        assertEquals(Mode.COMPRESSED,          IntegerCompressor.compressionMode(-0x1fffffff,  0x00000000));
        assertEquals(Mode.COMPRESSED,          IntegerCompressor.compressionMode(-0x00000001,  0x1fffffff));
        assertEquals(Mode.COMPRESSED_POSITIVE, IntegerCompressor.compressionMode( 0x00000000,  0x00000000));
        assertEquals(Mode.COMPRESSED_POSITIVE, IntegerCompressor.compressionMode( 0x00000000,  0x3fffffff));
        assertEquals(Mode.COMPRESSED_POSITIVE, IntegerCompressor.compressionMode( 0x3fffffff,  0x3fffffff));
    }