I have an association between Person and Department, and I want to check if Person.function is unique
Person.allInstances->isUnique(function)
but I want to check if function is unique for Persons in the same department and not between all persons. I can have the same function but not in the same department. I don't know how to use isUnique for each department (Persons group by department).