public static int computeMaxLEPower2(int num) {
        num |= (num >>> 1);
        num |= (num >>> 2);
        num |= (num >>> 4);
        num |= (num >>> 8);
        num |= (num >>> 16);
        return num - (num >>> 1);
    }
@Test
    public void testComputeMaxLEPower2() {
        Assert.assertEquals(0, Utils.computeMaxLEPower2(0));

        for (int i = 1; i < 10000; i++) {
            int out = Utils.computeMaxLEPower2(i);
            // The number i belongs to the range [out, out*2).
            Assert.assertTrue(out <= i);
            Assert.assertTrue(out * 2 > i);
        }
    }