static void addGetCharacteristicMethod(final String characteristicVariableName,
                                           final Characteristic characteristic,
                                           final List<Field<?>> fields,
                                           final ClassOrInterfaceDeclaration characteristicsTemplate) {
        BlockStmt toAdd = getCharacteristicVariableDeclaration(characteristicVariableName, characteristic, fields);
        toAdd.addStatement(new ReturnStmt(characteristicVariableName));
        final MethodDeclaration methodDeclaration =
                characteristicsTemplate.addMethod("get" + characteristicVariableName).setBody(toAdd);
        methodDeclaration.setType(KiePMMLCharacteristic.class);
        methodDeclaration.setModifiers(Modifier.Keyword.PRIVATE, Modifier.Keyword.STATIC);
    }
@Test
    void addGetCharacteristicMethod() throws IOException {
        final String characteristicName = "CharacteristicName";
        String expectedMethod = "get" + characteristicName;
        assertThat(characteristicsTemplate.getMethodsByName(expectedMethod)).isEmpty();
        KiePMMLCharacteristicsFactory.addGetCharacteristicMethod(characteristicName,
                basicComplexPartialScoreFirstCharacteristic,
                getFieldsFromDataDictionary(basicComplexPartialScoreDataDictionary),
                characteristicsTemplate);
        assertThat(characteristicsTemplate.getMethodsByName(expectedMethod)).hasSize(1);
        MethodDeclaration retrieved = characteristicsTemplate.getMethodsByName(expectedMethod).get(0);
        String text = getFileContent(TEST_01_SOURCE);
        MethodDeclaration expected = JavaParserUtils
                .parseMethod(String.format(text, characteristicName));
        assertThat(JavaParserUtils.equalsNode(expected, retrieved)).isTrue();
        List<Class<?>> imports = Arrays.asList(KiePMMLApply.class,
                KiePMMLAttribute.class,
                KiePMMLCharacteristic.class,
                KiePMMLCharacteristics.class,
                KiePMMLComplexPartialScore.class,
                KiePMMLCompoundPredicate.class,
                KiePMMLConstant.class,
                KiePMMLFieldRef.class,
                KiePMMLSimplePredicate.class,
                KiePMMLSimpleSetPredicate.class,
                KiePMMLTruePredicate.class,
                Arrays.class,
                Collections.class);
        commonValidateCompilationWithImports(retrieved, imports);
    }