KiePMMLSegmentFactory { public static Map<String, String> getSegmentsSourcesMap(final String parentPackageName, final DataDictionary dataDictionary, final TransformationDictionary transformationDictionary, final List<Segment> segments, final KnowledgeBuilder kBuilder, final List<KiePMMLModel> nestedModels) { logger.debug(GET_SEGMENTS, segments); final Map<String, String> toReturn = new HashMap<>(); segments.forEach(segment -> toReturn.putAll(getSegmentSourcesMap(parentPackageName, dataDictionary, transformationDictionary, segment, kBuilder, nestedModels))); return toReturn; } private  KiePMMLSegmentFactory(); static List<KiePMMLSegment> getSegments(final DataDictionary dataDictionary,
                                                   final TransformationDictionary transformationDictionary,
                                                   final List<Segment> segments,
                                                   final KnowledgeBuilder kBuilder); static KiePMMLSegment getSegment(final DataDictionary dataDictionary,
                                            final TransformationDictionary transformationDictionary,
                                            final Segment segment,
                                            final KnowledgeBuilder kBuilder); static Map<String, String> getSegmentsSourcesMap(final String parentPackageName,
                                                            final DataDictionary dataDictionary,
                                                            final TransformationDictionary transformationDictionary,
                                                            final List<Segment> segments,
                                                            final KnowledgeBuilder kBuilder,
                                                            final List<KiePMMLModel> nestedModels); static Map<String, String> getSegmentSourcesMap(
            final String parentPackageName,
            final DataDictionary dataDictionary,
            final TransformationDictionary transformationDictionary,
            final Segment segment,
            final KnowledgeBuilder kBuilder,
            final List<KiePMMLModel> nestedModels); static Map<String, String> getSegmentSourcesMap(
            final String packageName,
            final DataDictionary dataDictionary,
            final Segment segment);  }
@Test public void getSegmentsSourcesMap() { final List<Segment> segments = MINING_MODEL.getSegmentation().getSegments(); final String packageName = "packagename"; final List<KiePMMLModel> nestedModels = new ArrayList<>(); final Map<String, String> retrieved = KiePMMLSegmentFactory.getSegmentsSourcesMap( packageName, DATA_DICTIONARY, TRANSFORMATION_DICTIONARY, segments, KNOWLEDGE_BUILDER, nestedModels); assertNotNull(retrieved); commonEvaluateNestedModels(nestedModels); for (Segment segment : segments) { commonEvaluateMap(retrieved, segment); } }