public static LinkedHashMap<String, KiePMMLRegressionTable> getRegressionTables(final RegressionCompilationDTO compilationDTO) {
        logger.trace("getRegressionTables {}", compilationDTO.getRegressionTables());
        LinkedHashMap<String, KiePMMLRegressionTable> toReturn = new LinkedHashMap<>();
        for (RegressionTable regressionTable : compilationDTO.getRegressionTables()) {
            final KiePMMLRegressionTable kiePMMLRegressionTable = getRegressionTable(regressionTable,
                                                                                     compilationDTO);
            String targetCategory = regressionTable.getTargetCategory() != null ?
                    regressionTable.getTargetCategory().toString() : "";
            toReturn.put(targetCategory, kiePMMLRegressionTable);
        }
        return toReturn;
    }
@Test
    void getRegressionTables() {
        regressionTable = getRegressionTable(3.5, "professional");
        RegressionTable regressionTable2 = getRegressionTable(3.9, "hobby");
        RegressionModel regressionModel = new RegressionModel();
        regressionModel.setNormalizationMethod(RegressionModel.NormalizationMethod.CAUCHIT);
        regressionModel.addRegressionTables(regressionTable, regressionTable2);
        regressionModel.setModelName(getGeneratedClassName("RegressionModel"));
        String targetField = "targetField";
        DataField dataField = new DataField();
        dataField.setName(targetField);
        dataField.setOpType(OpType.CATEGORICAL);
        DataDictionary dataDictionary = new DataDictionary();
        dataDictionary.addDataFields(dataField);
        MiningField miningField = new MiningField();
        miningField.setUsageType(MiningField.UsageType.TARGET);
        miningField.setName(dataField.getName());
        MiningSchema miningSchema = new MiningSchema();
        miningSchema.addMiningFields(miningField);
        regressionModel.setMiningSchema(miningSchema);
        PMML pmml = new PMML();
        pmml.setDataDictionary(dataDictionary);
        pmml.addModels(regressionModel);
        final CommonCompilationDTO<RegressionModel> source =
                CommonCompilationDTO.fromGeneratedPackageNameAndFields(PACKAGE_NAME,
                                                                       pmml,
                                                                       regressionModel,
                                                                       new PMMLCompilationContextMock(),
                                                                       "FILENAME");
        final RegressionCompilationDTO compilationDTO =
                RegressionCompilationDTO.fromCompilationDTORegressionTablesAndNormalizationMethod(source,
                                                                                                  regressionModel.getRegressionTables(),
                                                                                                  regressionModel.getNormalizationMethod());

        Map<String, KiePMMLRegressionTable> retrieved =
                KiePMMLRegressionTableFactory.getRegressionTables(compilationDTO);
        assertThat(retrieved).isNotNull();
        assertThat(retrieved).hasSameSizeAs(regressionModel.getRegressionTables());
        regressionModel.getRegressionTables().forEach(regrTabl -> {
            assertThat(retrieved).containsKey(regrTabl.getTargetCategory().toString());
            commonEvaluateRegressionTable(retrieved.get(regrTabl.getTargetCategory().toString()), regrTabl);
        });
    }