KiePMMLSegmentFactory { public static List<KiePMMLSegment> getSegments(final DataDictionary dataDictionary, final TransformationDictionary transformationDictionary, final List<Segment> segments, final KnowledgeBuilder kBuilder) { logger.debug(GET_SEGMENTS, segments); return segments.stream().map(segment -> getSegment(dataDictionary, transformationDictionary, segment, kBuilder)).collect(Collectors.toList()); } 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 getSegments() { final List<Segment> segments = MINING_MODEL.getSegmentation().getSegments(); final List<KiePMMLSegment> retrieved = KiePMMLSegmentFactory.getSegments(DATA_DICTIONARY, TRANSFORMATION_DICTIONARY, segments, KNOWLEDGE_BUILDER); assertNotNull(retrieved); assertEquals(segments.size(), retrieved.size()); for (int i = 0; i < segments.size(); i++) { commonEvaluateSegment(retrieved.get(i), segments.get(i)); } }