public static Map<String, String> getSegmentsSourcesMap(final MiningModelCompilationDTO compilationDTO,
                                                            final List<KiePMMLModel> nestedModels) {
        final List<Segment> segments = compilationDTO.getModel().getSegmentation().getSegments();
        logger.debug(GET_SEGMENTS, segments);
        final Map<String, String> toReturn = new HashMap<>();
        segments.forEach(segment -> {
            final SegmentCompilationDTO segmentCompilationDTO =
                    SegmentCompilationDTO.fromGeneratedPackageNameAndFields(compilationDTO, segment,
                                                                            compilationDTO.getFields());
            toReturn.putAll(getSegmentSourcesMap(segmentCompilationDTO, nestedModels));
            compilationDTO.addFields(segmentCompilationDTO.getFields());
        });

        return toReturn;
    }
@Test
    void getSegmentsSourcesMap() {
        final List<Segment> segments = MINING_MODEL.getSegmentation().getSegments();
        final List<KiePMMLModel> nestedModels = new ArrayList<>();
        final CommonCompilationDTO<MiningModel> source =
                CommonCompilationDTO.fromGeneratedPackageNameAndFields(PACKAGE_NAME,
                        pmml,
                        MINING_MODEL,
                        new PMMLCompilationContextMock(),
                                                                       "FILENAME");
        final MiningModelCompilationDTO compilationDTO =
                MiningModelCompilationDTO.fromCompilationDTO(source);
        final Map<String, String> retrieved = KiePMMLSegmentFactory.getSegmentsSourcesMap(
                compilationDTO,
                nestedModels);
        assertThat(retrieved).isNotNull();
        commonEvaluateNestedModels(nestedModels);
        for (Segment segment : segments) {
            commonEvaluateMap(retrieved, segment);
        }
    }