@Test public void describesItselfWithToStringMethod() { Matcher<Object> someMatcher = new BaseMatcher<Object>() { @Override public boolean matches(Object item) { throw new UnsupportedOperationException(); } @Override public void describeTo(Description description) { description.appendText("SOME DESCRIPTION"); } }; assertEquals("SOME DESCRIPTION", someMatcher.toString()); }
@Override public String toString() { return StringDescription.toString(this); }
BaseMatcher implements Matcher<T> { @Override public String toString() { return StringDescription.toString(this); } }
BaseMatcher implements Matcher<T> { @Override public String toString() { return StringDescription.toString(this); }  }
BaseMatcher implements Matcher<T> { @Override public String toString() { return StringDescription.toString(this); }  @Override @Deprecated final void _dont_implement_Matcher___instead_extend_BaseMatcher_(); @Override void describeMismatch(Object item, Description description); @Override String toString(); }
BaseMatcher implements Matcher<T> { @Override public String toString() { return StringDescription.toString(this); }  @Override @Deprecated final void _dont_implement_Matcher___instead_extend_BaseMatcher_(); @Override void describeMismatch(Object item, Description description); @Override String toString();  }