MathUtils { public static boolean isAlmostZero(final double x) { return isAlmostEqual(x, 0.0); } private  MathUtils(); static double findMin(@Nonnull final double[] a); static double findMax(@Nonnull final double[] a); static boolean isAlmostZero(final double x); static boolean isAlmostEqual(final double x, final double y); static boolean isBetween(final int value, final int min, final int max); static boolean isBetween(final double value, final double min, final double max); static int limitTo(final int value, final int min, final int max); static double limitTo(final double value, final double min, final double max); static int random(final int min, final int max); static void setRandomSeed(final long seed); static double wrapValueToWithinLimits(
            final double value,
            final int limit); static final double EPSILON; }
@Test public void testIsAlmostZero() { LOG.info("testIsAlmostZero"); Assert.assertTrue(MathUtils.isAlmostZero(0)); Assert.assertFalse(MathUtils.isAlmostZero(0.01)); Assert.assertFalse(MathUtils.isAlmostZero(-0.01)); Assert.assertTrue(MathUtils.isAlmostZero(MathUtils.EPSILON / 2)); Assert.assertTrue(MathUtils.isAlmostZero(-MathUtils.EPSILON / 2)); Assert.assertFalse(MathUtils.isAlmostZero(MathUtils.EPSILON * 2)); Assert.assertFalse(MathUtils.isAlmostZero(-MathUtils.EPSILON * 2)); }