public static boolean isPowerOfTwo(long x) {
        return (x & (x - 1)) == 0;
    }
@Test
    public void testIsPowerOfTwo() {
        assertTrue(QuickMath.isPowerOfTwo(1));
        assertTrue(QuickMath.isPowerOfTwo(2));
        assertFalse(QuickMath.isPowerOfTwo(3));
        assertTrue(QuickMath.isPowerOfTwo(1024));
        assertFalse(QuickMath.isPowerOfTwo(1023));
        assertFalse(QuickMath.isPowerOfTwo(Integer.MAX_VALUE));
    }