IsYaml 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 yaml"); }  static Matcher<T> yaml(); @Override void describeTo(final Description description);  }
@Test public void testDescribeMismatchSafely() throws Exception { assertHasMismatchDescription(format("<%s> is not a valid yaml", NON_VALID_YAML), isYamlMatcher, NON_VALID_YAML); }