code: public Rule getRule(final String symbol, final Stack stack) {
      if (AND_RULE.equals(symbol)) {
        return AndRule.getRule(stack);
      }
  
      if (OR_RULE.equals(symbol)) {
        return OrRule.getRule(stack);
      }
  
      if (NOT_RULE.equals(symbol)) {
        return NotRule.getRule(stack);
      }
  
      if (NOT_EQUALS_RULE.equals(symbol)) {
        return NotEqualsRule.getRule(stack);
      }
  
      if (EQUALS_RULE.equals(symbol)) {
        return EqualsRule.getRule(stack);
      }
  
      if (PARTIAL_TEXT_MATCH_RULE.equals(symbol)) {
        return PartialTextMatchRule.getRule(stack);
      }
  
      if (RULES.contains(LIKE_RULE) && LIKE_RULE.equalsIgnoreCase(symbol)) {
        return LikeRule.getRule(stack);
      }
  
      if (EXISTS_RULE.equalsIgnoreCase(symbol)) {
        return ExistsRule.getRule(stack);
      }
  
      if (LESS_THAN_RULE.equals(symbol)) {
        return InequalityRule.getRule(LESS_THAN_RULE, stack);
      }
  
      if (GREATER_THAN_RULE.equals(symbol)) {
        return InequalityRule.getRule(GREATER_THAN_RULE, stack);
      }
  
      if (LESS_THAN_EQUALS_RULE.equals(symbol)) {
        return InequalityRule.getRule(LESS_THAN_EQUALS_RULE, stack);
      }
  
      if (GREATER_THAN_EQUALS_RULE.equals(symbol)) {
        return InequalityRule.getRule(GREATER_THAN_EQUALS_RULE, stack);
      }
      throw new IllegalArgumentException("Invalid rule: " + symbol);
    }
docs: Create rule from applying operator to stack.
  @param symbol symbol
  @param stack stack
  @return new instance