@Override
    public ValidationResult validate(RuleBuilderStep step) {
        final RuleFragment ruleFragment = actions.get(step.function());

        if (step.negate()) {
            if (ruleFragment.isFragment()) {
                return new ValidationResult(true, "Negation of fragments not possible ");
            } else {
                FunctionDescriptor<?> function = ruleFragment.descriptor();
                if (!function.returnType().equals(Boolean.class)) {
                    return new ValidationResult(true, "None boolean function " + step.function() + " cannot be negated.");
                }
            }
        }
        return new ValidationResult(false, "");
    }
@Test
    void validate() {
        RuleBuilderStep stepWithValidNegation = RuleBuilderStep.builder().negate(true).function(VALID_NEGATION).build();
        RuleBuilderStep stepWithInvalidNegation = RuleBuilderStep.builder().negate(true).function(INVALID_NEGATION).build();
        RuleBuilderStep stepWithNoNegation = RuleBuilderStep.builder().negate(false).function(INVALID_NEGATION).build();
        RuleBuilderStep stepWithFragment = RuleBuilderStep.builder().negate(true).function(VALID_FRAGMENT_NEGATION).build();

        assertThat(classUnderTest.validate(stepWithValidNegation).failed()).isFalse();
        assertThat(classUnderTest.validate(stepWithInvalidNegation).failed()).isTrue();
        assertThat(classUnderTest.validate(stepWithNoNegation).failed()).isFalse();
        assertThat(classUnderTest.validate(stepWithFragment).failed()).isTrue();
    }