class AbstractRuleFactory {

    private static final Logger LOGGER = LoggerFactory.getLogger(AbstractRuleFactory.class);

    private static final List<String> ALLOWED_COMPOSITE_RULE_TYPES = Arrays.asList(
            UnitRuleGroup.class.getSimpleName(),
            ConditionalRuleGroup.class.getSimpleName(),
            ActivationRuleGroup.class.getSimpleName()
    );

    protected Rule createRule(RuleDefinition ruleDefinition) {
        if (ruleDefinition.isCompositeRule()) {
            return createCompositeRule(ruleDefinition);
        } else {
            return createSimpleRule(ruleDefinition);
        }
    }

    protected abstract Rule createSimpleRule(RuleDefinition ruleDefinition);

    protected Rule createCompositeRule(RuleDefinition ruleDefinition) {<FILL_FUNCTION_BODY>}

}

        if (ruleDefinition.getCondition() != null) {
            LOGGER.warn(
                    "Condition '{}' in composite rule '{}' of type {} will be ignored.",
                    ruleDefinition.getCondition(),
                    ruleDefinition.getName(),
                    ruleDefinition.getCompositeRuleType());
        }
        if (ruleDefinition.getActions() != null && !ruleDefinition.getActions().isEmpty()) {
            LOGGER.warn(
                    "Actions '{}' in composite rule '{}' of type {} will be ignored.",
                    ruleDefinition.getActions(),
                    ruleDefinition.getName(),
                    ruleDefinition.getCompositeRuleType());
        }
        CompositeRule compositeRule;
        String name = ruleDefinition.getName();
        switch (ruleDefinition.getCompositeRuleType()) {
            case "UnitRuleGroup":
                compositeRule = new UnitRuleGroup(name);
                break;
            case "ActivationRuleGroup":
                compositeRule = new ActivationRuleGroup(name);
                break;
            case "ConditionalRuleGroup":
                compositeRule = new ConditionalRuleGroup(name);
                break;
            default:
                throw new IllegalArgumentException("Invalid composite rule type, must be one of " + ALLOWED_COMPOSITE_RULE_TYPES);
        }
        compositeRule.setDescription(ruleDefinition.getDescription());
        compositeRule.setPriority(ruleDefinition.getPriority());

        for (RuleDefinition composingRuleDefinition : ruleDefinition.getComposingRules()) {
            compositeRule.addRule(createRule(composingRuleDefinition));
        }

        return compositeRule;
    
<no_super_class>