### Question:
MathUtils { public static boolean nearZero(double value, double tolerance) { return value >= -tolerance && value <= tolerance; } private  MathUtils(); static double pow2(double value); static double pow3(double value); static double pow4(double value); static boolean nearZero(double value, double tolerance); static boolean nearOne(double value, double tolerance);  }### Answer:
@Test public void test_nearZero() { assertThat(MathUtils.nearZero(0, 0)).isTrue(); assertThat(MathUtils.nearZero(-0, 0)).isTrue(); assertThat(MathUtils.nearZero(0, 0.5)).isTrue(); assertThat(MathUtils.nearZero(-0, 0.5)).isTrue(); assertThat(MathUtils.nearZero(0.5, 0.5)).isTrue(); assertThat(MathUtils.nearZero(Math.nextAfter(0.5, -1000d), 0.5)).isTrue(); assertThat(MathUtils.nearZero(Math.nextAfter(0.5, 1000d), 0.5)).isFalse(); assertThat(MathUtils.nearZero(-0.5, 0.5)).isTrue(); assertThat(MathUtils.nearZero(Math.nextAfter(-0.5, -1000d), 0.5)).isFalse(); assertThat(MathUtils.nearZero(Math.nextAfter(-0.5, 1000d), 0.5)).isTrue(); assertThat(MathUtils.nearZero(Double.POSITIVE_INFINITY, 0.5)).isFalse(); assertThat(MathUtils.nearZero(Double.NEGATIVE_INFINITY, 0.5)).isFalse(); assertThat(MathUtils.nearZero(Double.NaN, 0.5)).isFalse(); }