class ConditionalRuleGroup extends CompositeRule {

    private Set<Rule> successfulEvaluations;
    private Rule conditionalRule;

    /**
     * Create a conditional rule group.
     */
    public ConditionalRuleGroup() {
    }

    /**
     * Create a conditional rule group.
     *
     * @param name of the conditional rule
     */
    public ConditionalRuleGroup(String name) {
        super(name);
    }

    /**
     * Create a conditional rule group.
     *
     * @param name        of the conditional rule
     * @param description of the conditional rule
     */
    public ConditionalRuleGroup(String name, String description) {
        super(name, description);
    }

    /**
     * Create a conditional rule group.
     *
     * @param name        of the conditional rule
     * @param description of the conditional rule
     * @param priority    of the composite rule
     */
    public ConditionalRuleGroup(String name, String description, int priority) {
        super(name, description, priority);
    }

    /**
     * A conditional rule group will trigger all its composing rules if the condition
     * of the rule with highest priority evaluates to true.
     * 
     * @param facts The facts.
     * @return true if the conditions of all composing rules evaluate to true
     */
    @Override
    public boolean evaluate(Facts facts) {<FILL_FUNCTION_BODY>}

    /**
     * When a conditional rule group is executed, all rules that evaluated to true
     * are performed in their natural order, but with the conditional rule 
     * (the one with the highest priority) first.
     *
     * @param facts The facts.
     *
     * @throws Exception thrown if an exception occurs during actions performing
     */
    @Override
    public void execute(Facts facts) throws Exception {
        conditionalRule.execute(facts);
        for (Rule rule : sort(successfulEvaluations)) {
            rule.execute(facts);
        }
    }

    private Rule getRuleWithHighestPriority() {
        List<Rule> copy = sort(rules);
        // make sure we only have one rule with the highest priority
        Rule highest = copy.get(0);
        if (copy.size() > 1 && copy.get(1).getPriority() == highest.getPriority()) {
           throw new IllegalArgumentException("Only one rule can have highest priority");
        }
        return highest;
    }

    private List<Rule> sort(Set<Rule> rules) {
        return new ArrayList<>(new TreeSet<>(rules));
    }

}

        successfulEvaluations = new HashSet<>();
        conditionalRule = getRuleWithHighestPriority();
        if (conditionalRule.evaluate(facts)) {
            for (Rule rule : rules) {
                if (rule != conditionalRule && rule.evaluate(facts)) {
                    successfulEvaluations.add(rule);
                }
            }
            return true;
        }
        return false;
    
<methods>public void <init>() ,public void <init>(java.lang.String) ,public void <init>(java.lang.String, java.lang.String) ,public void <init>(java.lang.String, java.lang.String, int) ,public void addRule(java.lang.Object) ,public abstract boolean evaluate(org.jeasy.rules.api.Facts) ,public abstract void execute(org.jeasy.rules.api.Facts) throws java.lang.Exception,public void removeRule(java.lang.Object) <variables>private final non-sealed Map<java.lang.Object,org.jeasy.rules.api.Rule> proxyRules,protected Set<org.jeasy.rules.api.Rule> rules