WaksmanUtils { public boolean isPow2(int n) { return n >= 0 && ((n & (n - 1)) == 0); }  int getNumRowsRequired(int n); int getNumColsRequired(int n); boolean isPow2(int n); int[] invert(int[] p); Matrix<BigInteger> setControlBits(int[] perm);  }
@Test public void testIs2Pow(){ WaksmanUtils util = new WaksmanUtils(); assertFalse(util.isPow2(-2)); assertFalse(util.isPow2(14)); assertFalse(util.isPow2(5)); assertTrue(util.isPow2(4)); assertTrue(util.isPow2(8)); assertFalse(util.isPow2(-8)); }