static BlockStmt getComplexPartialScoreVariableDeclaration(final String variableName, final ComplexPartialScore complexPartialScore) {
        final MethodDeclaration methodDeclaration = COMPLEX_PARTIAL_SCORE_TEMPLATE.getMethodsByName(GETKIEPMMLCOMPLEXPARTIALSCORE).get(0).clone();
        final BlockStmt complexPartialScoreBody = methodDeclaration.getBody().orElseThrow(() -> new KiePMMLException(String.format(MISSING_BODY_TEMPLATE, methodDeclaration)));
        final VariableDeclarator variableDeclarator = getVariableDeclarator(complexPartialScoreBody, COMPLEX_PARTIAL_SCORE) .orElseThrow(() -> new KiePMMLException(String.format(MISSING_VARIABLE_IN_BODY, COMPLEX_PARTIAL_SCORE, complexPartialScoreBody)));
        variableDeclarator.setName(variableName);
        final BlockStmt toReturn = new BlockStmt();
        String nestedVariableName = String.format(VARIABLE_NAME_TEMPLATE, variableName, 0);
        BlockStmt toAdd = getKiePMMLExpressionBlockStmt(nestedVariableName, complexPartialScore.getExpression());
        toAdd.getStatements().forEach(toReturn::addStatement);

        final ObjectCreationExpr objectCreationExpr = variableDeclarator.getInitializer()
                .orElseThrow(() -> new KiePMMLException(String.format(MISSING_VARIABLE_INITIALIZER_TEMPLATE, COMPLEX_PARTIAL_SCORE, toReturn)))
        .asObjectCreationExpr();
        objectCreationExpr.getArguments().set(0, new StringLiteralExpr(variableName));
        objectCreationExpr.getArguments().set(2, new NameExpr(nestedVariableName));
        complexPartialScoreBody.getStatements().forEach(toReturn::addStatement);
        return toReturn;
    }
@Test
    void getComplexPartialScoreVariableDeclarationWithApply() throws IOException {
        final String variableName = "variableName";
        Constant constant = new Constant();
        constant.setValue(value1);
        FieldRef fieldRef = new FieldRef();
        fieldRef.setField("FIELD_REF");
        Apply apply = new Apply();
        apply.setFunction("/");
        apply.addExpressions(constant, fieldRef);
        ComplexPartialScore complexPartialScore = new ComplexPartialScore();
        complexPartialScore.setExpression(apply);
        BlockStmt retrieved =
                KiePMMLComplexPartialScoreFactory.getComplexPartialScoreVariableDeclaration(variableName,
                        complexPartialScore);
        String text = getFileContent(TEST_03_SOURCE);
        Statement expected = JavaParserUtils.parseBlock(String.format(text,
                constant.getValue(),fieldRef.getField(),
                apply.getFunction(),
                apply.getInvalidValueTreatment().value(),
                variableName));
        assertThat(retrieved).isEqualTo(expected);
        List<Class<?>> imports = Arrays.asList(KiePMMLConstant.class,
                KiePMMLFieldRef.class,
                KiePMMLApply.class,
                KiePMMLComplexPartialScore.class,
                Arrays.class,
                Collections.class);
        commonValidateCompilationWithImports(retrieved, imports);
    }