code: public static void isPowerOfTwo( int argument,
                                       String name ) {
          if (Integer.bitCount(argument) != 1) {
              throw new IllegalArgumentException(CommonI18n.argumentMustBePowerOfTwo.text(name, argument));
          }
      }
docs: Check that the argument is a power of 2.
  
  @param argument The argument
  @param name The name of the argument
  @throws IllegalArgumentException If argument is not a power of 2