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