package org.hamcrest; import org.junit.Test; import static org.junit.Assert.assertEquals; public final class BaseMatcherTest { @Test public void describesItselfWithToStringMethod() { Matcher someMatcher = new BaseMatcher() { @Override public boolean matches(Object item) { throw new UnsupportedOperationException(); } @Override public void describeTo(Description description) { description.appendText("SOME DESCRIPTION"); } }; assertEquals("SOME DESCRIPTION", someMatcher.toString()); } }