code: public static boolean equalWithinTolerance(double left, double right, double tolerance) {
      return Math.abs(left - right) <= Math.abs(tolerance);
    }
docs: Returns true iff {@code left} and {@code right} are finite values within {@code tolerance} of
  each other. Note that both this method and {@link #notEqualWithinTolerance} returns false if
  either {@code left} or {@code right} is infinite or NaN.