code: public static int lcm(int a, int b) throws ArithmeticException {
          if (a == 0 || b == 0) {
              return 0;
          }
          int lcm = Math.abs(addExact(a / gcd(a, b), b));
          if (lcm == Integer.MIN_VALUE) {
              throw new ArithmeticException();
          }
          return lcm;
      }
docs: <p>
  Returns the least common multiple of the absolute value of two numbers,
  using the formula {@code lcm(a,b) = (a / gcd(a,b)) * b}.
  </p>
  Special cases:
  <ul>
  <li>The invocations {@code lcm(Integer.MIN_VALUE, n)} and
  {@code lcm(n, Integer.MIN_VALUE)}, where {@code abs(n)} is a
  power of 2, throw an {@code ArithmeticException}, because the result
  would be 2^31, which is too large for an int value.</li>
  <li>The result of {@code lcm(0, x)} and {@code lcm(x, 0)} is
  {@code 0} for any {@code x}.
  </ul>
  
  @param a Number.
  @param b Number.
  @return the least common multiple, never negative.
  @throws ArithmeticException if the result cannot be represented as
  a non-negative {@code int} value.
  @since 1.1