IsNaN extends TypeSafeMatcher<Double> { public static Matcher<Double> notANumber() { return new IsNaN(); } private  IsNaN(); @Override boolean matchesSafely(Double item); @Override void describeMismatchSafely(Double item, Description mismatchDescription); @Override void describeTo(Description description); static Matcher<Double> notANumber();  }
@Test public void copesWithNullsAndUnknownTypes() { Matcher<Double> matcher = notANumber(); assertNullSafe(matcher); assertUnknownTypeSafe(matcher); }
@Test public void matchesNaN() { assertMatches(notANumber(), Double.NaN); }
@Test public void doesNotMatchDoubleValue() { assertDoesNotMatch(notANumber(), 1.25); }
@Test public void doesNotMatchInfinity() { assertDoesNotMatch(notANumber(), Double.POSITIVE_INFINITY); }
@Test public void describesItself() { assertDescription("a double value of NaN", notANumber()); }
@Test public void describesAMismatch() { assertMismatchDescription("was <1.25>", notANumber(), 1.25); }