IsBetweenLowerBoundInclusive extends TypeSafeMatcher<T> { @Override public void describeTo(final Description description) { description.appendText("a value between ").appendValue(from).appendText(" included and ").appendValue(to) .appendText(" excluded"); } IsBetweenLowerBoundInclusive(final T from, final T to); static Matcher<T> betweenLowerBoundInclusive(final T from, final T to); @Override void describeTo(final Description description);  }
@Test public void testDescribeTo() throws Exception { assertIsDescribedTo("a value between <10> included and <12> excluded", isBetweenLowerBoundInclusiveMatcher); }