MathUtils { public static boolean equals(double x, double y) { return new Double(x).equals(new Double(y)); } private  MathUtils(); static int hash(double value); static boolean equals(double x, double y); static int hash(double[] value); static double normalizeAngle(double a, double center); static double reduce(double a,
                                double period,
                                double offset); static byte copySign(byte magnitude, byte sign); static short copySign(short magnitude, short sign); static int copySign(int magnitude, int sign); static long copySign(long magnitude, long sign); static void checkFinite(final double x); static void checkFinite(final double[] val); static void checkNotNull(Object o,
                                    Localizable pattern,
                                    Object ... args); static void checkNotNull(Object o); static final double TWO_PI; static final double PI_SQUARED; }
@Test public void testEqualsDouble() { final double x = 1234.5678; Assert.assertTrue(MathUtils.equals(x, x)); Assert.assertFalse(MathUtils.equals(x, -x)); Assert.assertTrue(MathUtils.equals(Double.NaN, Double.NaN)); final double mZero = -0d; final double zero = 0d; Assert.assertTrue(MathUtils.equals(zero, zero)); Assert.assertTrue(MathUtils.equals(mZero, mZero)); Assert.assertFalse(MathUtils.equals(mZero, zero)); }