AdGroupAdOperation[] operations =
new AdGroupAdOperation[] {exemptableOperation, nonExemptableOperation};
try {
// Validate the ads.
AdGroupAdReturnValue result = adGroupAdValidationService.mutate(operations);
} catch (ApiException e) {
Set<Integer> indicesToRemove = new HashSet<Integer>();
for (ApiError error : e.getErrors()) {
if (error instanceof PolicyViolationError) {
PolicyViolationError policyVioloationError = (PolicyViolationError) error;