### Question:
MathUtils { public static boolean isPowerOfTwo(final int value) { if (value != 0) { return (value & -value) == value; } return false; } private  MathUtils(); static boolean isPowerOfTwo(final int value); static int nextPowerOfTwo(final int x); static double log2(final double x);  }### Answer:
@Test public void testIsPowerOfTwo() { assertFalse(MathUtils.isPowerOfTwo(0)); assertTrue(MathUtils.isPowerOfTwo(1)); assertTrue(MathUtils.isPowerOfTwo(2)); assertFalse(MathUtils.isPowerOfTwo(3)); assertTrue(MathUtils.isPowerOfTwo(4)); assertFalse(MathUtils.isPowerOfTwo(5)); assertFalse(MathUtils.isPowerOfTwo(7)); assertTrue(MathUtils.isPowerOfTwo(8)); assertFalse(MathUtils.isPowerOfTwo(9)); assertFalse(MathUtils.isPowerOfTwo(15)); assertTrue(MathUtils.isPowerOfTwo(16)); assertFalse(MathUtils.isPowerOfTwo(17)); assertFalse(MathUtils.isPowerOfTwo(31)); assertTrue(MathUtils.isPowerOfTwo(32)); assertFalse(MathUtils.isPowerOfTwo(33)); assertFalse(MathUtils.isPowerOfTwo(63)); assertTrue(MathUtils.isPowerOfTwo(64)); assertFalse(MathUtils.isPowerOfTwo(65)); assertFalse(MathUtils.isPowerOfTwo(127)); assertTrue(MathUtils.isPowerOfTwo(128)); assertFalse(MathUtils.isPowerOfTwo(129)); assertFalse(MathUtils.isPowerOfTwo(255)); assertTrue(MathUtils.isPowerOfTwo(256)); assertFalse(MathUtils.isPowerOfTwo(257)); assertFalse(MathUtils.isPowerOfTwo(511)); assertTrue(MathUtils.isPowerOfTwo(512)); assertFalse(MathUtils.isPowerOfTwo(513)); assertFalse(MathUtils.isPowerOfTwo(1023)); assertTrue(MathUtils.isPowerOfTwo(1024)); assertFalse(MathUtils.isPowerOfTwo(1025)); }