code: public static Fraction of(int numerator, int denominator, boolean reduce) {
  
          if (denominator == 0) {
              throw new ArithmeticException("The denominator must not be zero");
          }
  
          if (reduce) {
              // allow 2^k/-2^31 as a valid fraction (where k>0)
              if (denominator == Integer.MIN_VALUE && (numerator & 1) == 0) {
                  numerator /= 2;
                  denominator /= 2;
              }
          }
  
          if (denominator < 0) {
              if (numerator == Integer.MIN_VALUE || denominator == Integer.MIN_VALUE) {
                  throw new ArithmeticException("overflow: can't negate");
              }
              numerator = -numerator;
              denominator = -denominator;
          }
  
          if (reduce) {
              if (numerator == 0) {
                  return ZERO; // normalize zero.
              }
              // simplify fraction.
              final int gcd = greatestCommonDivisor(numerator, denominator);
              numerator /= gcd;
              denominator /= gcd;
              return new Fraction(numerator, denominator);
          } else {
              return new Fraction(numerator, denominator);
          }
      }
docs: <p>
  Creates a <code>Fraction</code> instance with the 2 parts of a fraction Y/Z.
  </p>
  
  <p>
  Any negative signs are resolved to be on the numerator.
  </p>
  
  @param numerator
  the numerator, for example the three in 'three sevenths'
  @param denominator
  the denominator, for example the seven in 'three sevenths'
  @param reduce
  if it's true, reduce <code>Fraction</code> instance with the 2 parts of a fraction Y/Z. For example,
  if the input parameters represent 2/4, then the created fraction will be 1/2.
  @return a new fraction instance
  @throws ArithmeticException
  if the denominator is <code>zero</code> or the denominator is {@code negative} and the numerator is
  {@code Integer#MIN_VALUE}