Matcher isBefore(DateTime expectedDateTime) { return matcher('to be before <$expectedDateTime>', (item, _) { assert(item is DateTime); return (item as DateTime).isBefore(expectedDateTime); }); }