Pass predicate as an argument