public static KiePMMLClusteringModel getKiePMMLClusteringModel(final ClusteringCompilationDTO compilationDTO) {
        logger.trace("getKiePMMLClusteringModel {}", compilationDTO);
        try {
            ClusteringModel clusteringModel = compilationDTO.getModel();
            final KiePMMLClusteringModel.ModelClass modelClass = modelClassFrom(clusteringModel.getModelClass());
            final List<KiePMMLCluster> clusters = getKiePMMLClusters(clusteringModel.getClusters());
            final List<KiePMMLClusteringField> clusteringFields = getKiePMMLClusteringFields(clusteringModel.getClusteringFields());
            final KiePMMLComparisonMeasure comparisonMeasure = getKiePMMLComparisonMeasure(clusteringModel.getComparisonMeasure());
            final KiePMMLMissingValueWeights missingValueWeights = getKiePMMLMissingValueWeights(clusteringModel.getMissingValueWeights());

            return KiePMMLClusteringModel.builder(compilationDTO.getFileName(), compilationDTO.getModelName(), compilationDTO.getMINING_FUNCTION())
                    .withModelClass(modelClass)
                    .withClusters(clusters)
                    .withClusteringFields(clusteringFields)
                    .withComparisonMeasure(comparisonMeasure)
                    .withMissingValueWeights(missingValueWeights)
                    .withTargetField(compilationDTO.getTargetFieldName())
                    .withMiningFields(compilationDTO.getKieMiningFields())
                    .withOutputFields(compilationDTO.getKieOutputFields())
                    .withKiePMMLMiningFields(compilationDTO.getKiePMMLMiningFields())
                    .withKiePMMLOutputFields(compilationDTO.getKiePMMLOutputFields())
                    .withKiePMMLTargets(compilationDTO.getKiePMMLTargetFields())
                    .withKiePMMLTransformationDictionary(compilationDTO.getKiePMMLTransformationDictionary())
                    .withKiePMMLLocalTransformations(compilationDTO.getKiePMMLLocalTransformations())
                    .build();
        } catch (Exception e) {
            throw new KiePMMLException(e);
        }
    }
@Test
    void getKiePMMLClusteringModel() {
        final CommonCompilationDTO<ClusteringModel> compilationDTO =
                CommonCompilationDTO.fromGeneratedPackageNameAndFields(PACKAGE_NAME,
                                                                       pmml,
                                                                       clusteringModel,
                                                                       new PMMLCompilationContextMock(),
                                                                       "fileName");
        KiePMMLClusteringModel retrieved =
                KiePMMLClusteringModelFactory.getKiePMMLClusteringModel(ClusteringCompilationDTO.fromCompilationDTO(compilationDTO));
        assertThat(retrieved).isNotNull();
        assertThat(retrieved.getName()).isEqualTo(clusteringModel.getModelName());
        assertThat(retrieved.getModelClass().getName()).isEqualTo(clusteringModel.getModelClass().value());
        List<KiePMMLCluster> retrievedClusters = retrieved.getClusters();
        assertThat(retrievedClusters).hasSameSizeAs(clusteringModel.getClusters());
        IntStream.range(0, clusteringModel.getClusters().size()).forEach(i -> commonEvaluateKiePMMLCluster(retrievedClusters.get(i), clusteringModel.getClusters().get(i)));
        List<KiePMMLClusteringField> retrievedClusteringFields = retrieved.getClusteringFields();
        assertThat(retrievedClusters).hasSameSizeAs(clusteringModel.getClusters());
        IntStream.range(0, clusteringModel.getClusters().size()).forEach(i -> commonEvaluateKiePMMLCluster(retrievedClusters.get(i), clusteringModel.getClusters().get(i)));
        assertThat(retrievedClusteringFields).hasSameSizeAs(clusteringModel.getClusteringFields());
        IntStream.range(0, clusteringModel.getClusteringFields().size()).forEach(i -> commonEvaluateKiePMMLClusteringField(retrievedClusteringFields.get(i), clusteringModel.getClusteringFields().get(i)));
        commonEvaluateKiePMMLComparisonMeasure(retrieved.getComparisonMeasure(),
                clusteringModel.getComparisonMeasure());
        commonEvaluateKiePMMLMissingValueWeights(retrieved.getMissingValueWeights(),
                clusteringModel.getMissingValueWeights());
    }