@GwtIncompatible("java.math.BigInteger")
public void testIsPowerOfTwo() {
for (int x : ALL_INTEGER_CANDIDATES) {
// Checks for a single bit set.
BigInteger bigX = BigInteger.valueOf(x);
boolean expected = (bigX.signum() > 0) && (bigX.bitCount() == 1);
assertEquals(expected, IntMath.isPowerOfTwo(x));
}
}
public void testLog2ZeroAlwaysThrows() {