code: public static int toLog2(final int value, final String argName) {
      checkIfPowerOf2(value, argName);
      return Integer.numberOfTrailingZeros(value);
    }
docs: Checks the given value if it is a power of 2. If not, it throws an exception.
  Otherwise, returns the log-base2 of the given value.
  @param value must be a power of 2 and greater than zero.
  @param argName the argument name used in the exception if thrown.
  @return the log-base2 of the given value