Matches the year from a HasDate.
Matcher hasYear(Object? matcher) => isA<HasDate>().having((d) => d.year, 'year', matcher);