public static int nextPowerOfTwo(final int value) {
        return 1 << (32 - Integer.numberOfLeadingZeros(value - 1));
    }
@Test
    public void testNextLongPowerOfTwo() {
        assertEquals(1L, QuickMath.nextPowerOfTwo(-9999999L));
        assertEquals(1L, QuickMath.nextPowerOfTwo(-1L));
        assertEquals(1L, QuickMath.nextPowerOfTwo(0L));
        assertEquals(1L, QuickMath.nextPowerOfTwo(1L));
        assertEquals(2L, QuickMath.nextPowerOfTwo(2L));
        assertEquals(4L, QuickMath.nextPowerOfTwo(3L));
        assertEquals(1L << 62, QuickMath.nextPowerOfTwo((1L << 61) + 1));
    }