### Question:
MathIgnoreNaN { public static double max(double a, double b) { if (Double.isNaN(a)) { return b; } if (Double.isNaN(b)) { return a; } return Math.max(a, b); }  static double min(double a, double b); static double max(double a, double b);  }### Answer:
@Test public void testMax1() { double result = MathIgnoreNaN.max(1, 2); assertThat(result, equalTo(2.0)); }
@Test public void testMax2() { double result = MathIgnoreNaN.max(1, Double.NaN); assertThat(result, equalTo(1.0)); }
@Test public void testMax3() { double result = MathIgnoreNaN.max(Double.NaN, 2); assertThat(result, equalTo(2.0)); }