IsEmptyOptional extends TypeSafeMatcher<Optional> { @Override protected void describeMismatchSafely(final Optional item, final Description mismatchDescription) { mismatchDescription.appendValue(item).appendText(" is not an withoutRepetitions optional"); }  static Matcher<Optional> emptyOptional(); @Override void describeTo(final Description description);  }
@Test public void testDescribeMismatchSafely() throws Exception { assertHasMismatchDescription("<Optional[]> is not an withoutRepetitions optional", isEmptyOptionalMatcher, Optional.of("")); }