I wonder if it would make sense to factor this out into a utility API somewhere so that setting up the predicates is easier, e.g. from tests?