// (CUSTOM_TARGETING_KEY_ID_1 == CUSTOM_TARGETING_VALUE_ID_1 AND
// (CUSTOM_TARGETING_KEY_ID_2 !=
// (CUSTOM_TARGETING_VALUE_ID_2 OR CUSTOM_TARGETING_VALUE_ID_3))
// OR
// (CUSTOM_TARGETING_KEY_ID_3 = CUSTOM_TARGETING_VALUE_ID_4)
CustomCriteriaSet topCustomCriteriaSet = new CustomCriteriaSet();
topCustomCriteriaSet.setLogicalOperator(CustomCriteriaSetLogicalOperator.OR);
// Create the sub expression:
//
// (CUSTOM_TARGETING_KEY_ID_1 == CUSTOM_TARGETING_VALUE_ID_1 AND
// (CUSTOM_TARGETING_KEY_ID_2 !=
// (CUSTOM_TARGETING_VALUE_ID_2 OR CUSTOM_TARGETING_VALUE_ID_3))
CustomCriteriaSet subCustomCriteriaSet = new CustomCriteriaSet();
subCustomCriteriaSet.setLogicalOperator(CustomCriteriaSetLogicalOperator.AND);
subCustomCriteriaSet.setChildren(
new CustomCriteriaNode[] {customCriteria1, customCriteria2});
// Combine the expression
// (CUSTOM_TARGETING_KEY_ID_3 = CUSTOM_TARGETING_VALUE_ID_4) with
// subCustomCriteriaSet.