### Question:
YearMatcher extends FeatureMatcher<DateTime, Integer> { public static Matcher<DateTime> inYear(Matcher<Integer> yearMatcher) { return new YearMatcher(yearMatcher); } YearMatcher(Matcher<Integer> subMatcher); static Matcher<DateTime> inYear(Matcher<Integer> yearMatcher); static Matcher<DateTime> inYear(Integer... years);  }### Answer:
@Test public void test() throws Exception { assertThat(inYear(2018), AllOf.<Matcher<DateTime>>allOf( matches(DateTime.parse("20181001T010001Z")), mismatches(DateTime.parse("20210901T005959Z"), "year was <2021>"), mismatches(DateTime.parse("20171101T010000Z"), "year was <2017>"), describesAs("year (<2018>)") )); assertThat(inYear(2018, 2019, 2020), AllOf.<Matcher<DateTime>>allOf( matches(DateTime.parse("20181001T010001Z")), matches(DateTime.parse("20190801T010002Z")), matches(DateTime.parse("20200601T010003Z")), mismatches(DateTime.parse("20110501T005959Z"), "year was <2011>"), mismatches(DateTime.parse("20170701T005958Z"), "year was <2017>"), mismatches(DateTime.parse("20210901T005957Z"), "year was <2021>"), mismatches(DateTime.parse("20301101T010000Z"), "year was <2030>"), describesAs("year (<2018> or <2019> or <2020>)") )); }