IsEmail extends TypeSafeMatcher<T> { @Override protected void describeMismatchSafely(final T item, final Description mismatchDescription) { mismatchDescription.appendText(String.format("<%s>", item.toString())).appendText( " is not a valid email address"); }  static Matcher<T> email(); @Override void describeTo(final Description description);  }
@Test public void testDescribeMismatchSafely() throws Exception { for (final Object email : NON_VALID_EMAILS) { assertHasMismatchDescription(format("<%s> is not a valid email address", email), isEmailMatcher, email); } }