Is extends BaseMatcher<T> { public Is(Matcher<T> matcher) { this.matcher = matcher; } Is(Matcher<T> matcher); @Override boolean matches(Object arg); @Override void describeTo(Description description); @Override void describeMismatch(Object item, Description mismatchDescription); static Matcher<T> is(Matcher<T> matcher); static Matcher<T> is(T value); static Matcher<T> isA(Class<?> type);  }
@Test public void copesWithNullsAndUnknownTypes() { Matcher<String> matcher = is("something"); assertNullSafe(matcher); assertUnknownTypeSafe(matcher); }
@Test public void matchesTheSameWayTheUnderlyingMatcherDoes() { final Matcher<Boolean> matcher = is(equalTo(true)); assertMatches(matcher, true); assertDoesNotMatch(matcher, false); }
@Test public void generatesIsPrefixInDescription() { assertDescription("is <true>", is(equalTo(true))); assertDescription("is \"A\"", is("A")); }
@Test public void providesConvenientShortcutForIsEqualTo() { final Matcher<String> matcher = is("A"); assertMatches(matcher, "A"); assertDoesNotMatch(is("A"), "B"); }