code: public static int hexDigitToInt(final char hexDigit) {
          final int digit = Character.digit(hexDigit, 16);
          if (digit < 0) {
              throw new IllegalArgumentException("Cannot interpret '" + hexDigit + "' as a hexadecimal digit");
          }
          return digit;
      }
docs: <p>
  Converts a hexadecimal digit into an int using the default (Lsb0) bit ordering.
  </p>
  <p>
  '1' is converted to 1
  </p>
  
  @param hexDigit the hexadecimal digit to convert
  @return an int equals to {@code hexDigit}
  @throws IllegalArgumentException if {@code hexDigit} is not a hexadecimal digit