class KiePMMLRegressionTableRegressionFactory {

    static void populateUpdateResult(final ClassOrInterfaceDeclaration tableTemplate,
                                               final RegressionModel.NormalizationMethod normalizationMethod) {
        try {
            templateEvaluate = getFromFileName(KIE_PMML_UPDATE_RESULT_METHOD_TEMPLATE_JAVA);
            cloneEvaluate = templateEvaluate.clone();
            ClassOrInterfaceDeclaration evaluateTemplateClass =
                    cloneEvaluate.getClassByName(KIE_PMML_UPDATE_RESULT_METHOD_TEMPLATE)
                            .orElseThrow(() -> new RuntimeException(MAIN_CLASS_NOT_FOUND));
            String methodName = String.format("update%sResult", normalizationMethod.name());
            MethodDeclaration methodDeclaration = evaluateTemplateClass.getMethodsByName(methodName).get(0);
            final BlockStmt body =
                    methodDeclaration.getBody().orElseThrow(() -> new KiePMMLInternalException(String.format(MISSING_BODY_TEMPLATE, methodDeclaration.getName())));
            MethodDeclaration targetMethod = tableTemplate.getMethodsByName("updateResult").get(0);
            targetMethod.setBody(body);
        } catch (Exception e) {
            throw new KiePMMLInternalException("Failed to populate UpdateResult", e);
        }
    }

    private  KiePMMLRegressionTableRegressionFactory();

}