protected ValidationResult callPreEntitlementRules(List<Rule> matchingRules, JsContext context) {
    ValidationResult result = new ValidationResult();
    for (Rule rule : matchingRules) {
      String validationJson = jsRules.invokeRule(PRE_PREFIX + rule.getRuleName(), context);

      // If the resulting validation json is empty, either the method
      // did not exist in the rules, or the method did not return
      // anything. In this case we skip the result.
      if (validationJson == null) {
        continue;
      }
      result.add(objectMapper.toObject(validationJson, ValidationResult.class));
    }
    return result;
  }
 protected void callPostUnbindRules(List<Rule> matchingRules) {
   for (Rule rule : matchingRules) {
     jsRules.invokeRule(POST_PREFIX + rule.getRuleName());
   }
 }