Language spanish = new Language();
spanish.setId(1003L);
List<CampaignCriterionOperation> operations = new ArrayList<CampaignCriterionOperation>();
for (Criterion criterion : new Criterion[] {california, mexico, english, spanish}) {
CampaignCriterionOperation operation = new CampaignCriterionOperation();
CampaignCriterion campaignCriterion = new CampaignCriterion();
campaignCriterion.setCampaignId(campaignId);
campaignCriterion.setCriterion(criterion);
operation.setOperand(campaignCriterion);
operation.setOperator(Operator.ADD);
operations.add(operation);
}
CampaignCriterionReturnValue result =
campaignCriterionService.mutate(operations