This method could be refactored to use more optimised predicates that iterate and exit early when something doesn't match.