I have the following code:
if (user.getNationalities() != null && !user.getNationalities().isEmpty()) { query.addCriteria(Criteria.where("