code: private static void setCampaignTargetingCriteria(
        Campaign campaign, AdWordsServicesInterface adWordsServices, AdWordsSession session)
        throws ApiException, RemoteException {
      // Get the CampaignCriterionService.
      CampaignCriterionServiceInterface campaignCriterionService =
          adWordsServices.get(session, CampaignCriterionServiceInterface.class);
  
      // Create locations. The IDs can be found in the documentation or
      // retrieved with the LocationCriterionService.
      Location california = new Location();
      california.setId(21137L);
  
      Location mexico = new Location();
      mexico.setId(2484L);
  
      // Create languages. The IDs can be found in the documentation or
      // retrieved with the ConstantDataService.
      Language english = new Language();
      english.setId(1000L);
  
      Language spanish = new Language();
      spanish.setId(1003L);
  
      List<Criterion> criteria = new ArrayList<>(Arrays.asList(california, mexico, english, spanish));
  
      // Create operations to add each of the criteria above.
      List<CampaignCriterionOperation> operations = new ArrayList<>();
      for (Criterion criterion : criteria) {
        CampaignCriterionOperation operation = new CampaignCriterionOperation();
  
        CampaignCriterion campaignCriterion = new CampaignCriterion();
        campaignCriterion.setCampaignId(campaign.getId());
        campaignCriterion.setCriterion(criterion);
        operation.setOperand(campaignCriterion);
  
        operation.setOperator(Operator.ADD);
  
        operations.add(operation);
      }
  
      // Set the campaign targets.
      CampaignCriterionReturnValue returnValue =
          campaignCriterionService.mutate(
              operations.toArray(new CampaignCriterionOperation[operations.size()]));
  
      if (returnValue != null && returnValue.getValue() != null) {
        // Display added campaign targets.
        for (CampaignCriterion campaignCriterion : returnValue.getValue()) {
          System.out.printf(
              "Campaign criteria of type '%s' and ID %d was added.%n",
              campaignCriterion.getCriterion().getCriterionType(),
              campaignCriterion.getCriterion().getId());
        }
      }
    }
docs: Sets the campaign's targeting criteria.