IsDateInDay extends TypeSafeMatcher<Date> { @Override public void describeTo(final Description description) { description.appendText("a date with day ").appendValue(dayOfWeek); } IsDateInDay(final int weekDay); static Matcher<Date> sunday(); static Matcher<Date> monday(); static Matcher<Date> tuesday(); static Matcher<Date> wednesday(); static Matcher<Date> thursday(); static Matcher<Date> friday(); static Matcher<Date> saturday(); @Override void describeTo(final Description description);  }
@Test public void testDescribeTo() throws Exception { BaseMatcherTest.assertIsDescribedTo("a date with day <SUNDAY>", sundayMatcher); BaseMatcherTest.assertIsDescribedTo("a date with day <MONDAY>", mondayMatcher); BaseMatcherTest.assertIsDescribedTo("a date with day <TUESDAY>", tuesdayMatcher); BaseMatcherTest.assertIsDescribedTo("a date with day <WEDNESDAY>", wednesdayMatcher); BaseMatcherTest.assertIsDescribedTo("a date with day <THURSDAY>", thursdayMatcher); BaseMatcherTest.assertIsDescribedTo("a date with day <FRIDAY>", fridayMatcher); BaseMatcherTest.assertIsDescribedTo("a date with day <SATURDAY>", saturdayMatcher); }