code: private static boolean compareFloatingPointNumbers(Object a, Object b, double epsilon)
      {
          double a1 = a instanceof Double ? (Double) a : (Float) a;
          double b1 = b instanceof Double ? (Double) b : (Float) b;
          return nearlyEqual(a1, b1, epsilon);
      }
docs: Compare if two floating point numbers are within a given range