IsDateInDay extends TypeSafeMatcher<Date> { public static Matcher<Date> thursday() { return new IsDateInDay(5); } 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 testThursday() throws Exception { final boolean matchesRightDay = thursdayMatcher.matches(thursday); final boolean matchesWrongDay = thursdayMatcher.matches(monday); BaseMatcherTest.assertMatches(matchesRightDay); BaseMatcherTest.assertDoesNotMatch(matchesWrongDay); }