@Test
public void declareRulesFromCharacteristics() {

    Characteristics characteristics = scorecardModel.getCharacteristics();
    String parentPath = "_will";
    List<KiePMMLDroolsRule> retrieved = getKiePMMLScorecardModelCharacteristicASTFactory()
            .declareRulesFromCharacteristics(characteristics, parentPath, null);
    final List<Characteristic> characteristicList = characteristics.getCharacteristics();
    List<Attribute> attributes = new ArrayList<>();
    AtomicInteger counter = new AtomicInteger(0);
    for (int i = 0; i < characteristicList.size(); i++) {
        Characteristic characteristic = characteristicList.get(i);
        attributes.addAll(characteristic.getAttributes());
        for (int j = 0; j < characteristic.getAttributes().size(); j++) {
            Attribute attribute = characteristic.getAttributes().get(j);
            KiePMMLDroolsRule rule = retrieved.get(counter.incrementAndGet());
            int expectedOperatorValuesSize = 1;
            Integer expectedAndConstraints = null;
            Integer expectedInConstraints = null;
            BOOLEAN_OPERATOR expectedOperator = BOOLEAN_OPERATOR.AND;
            if (attribute.getPredicate() instanceof SimplePredicate) {
                expectedAndConstraints = 1;
            }
            if (attribute.getPredicate() instanceof CompoundPredicate) {
                expectedOperatorValuesSize = ((CompoundPredicate) attribute.getPredicate()).getPredicates().size();
                expectedAndConstraints = 1;
            }
            if (attribute.getPredicate() instanceof SimpleSetPredicate) {
                expectedInConstraints = 1;
            }
            boolean isLastCharacteristic = (i == characteristicList.size() - 1);
            String statusToSet = isLastCharacteristic ? DONE : String.format(PATH_PATTERN, parentPath, characteristicList.get(i + 1).getName());
            commonValidateRule(rule,
                               attribute,
                               statusToSet,
                               parentPath + "_" + characteristic.getName(),
                               j,
                               isLastCharacteristic,
                               expectedAndConstraints,
                               expectedInConstraints,
                               expectedOperator,
                               null,
                               expectedOperatorValuesSize);
        }
    }
    assertEquals(attributes.size() + 1, retrieved.size());
}