static void populateCorrectSegmentId(final Segment segment, final String modelName, final int i) {
        String toSet;
        if (segment.getId() == null || segment.getId().isEmpty()) {
            toSet = String.format(SEGMENTID_TEMPLATE,
                                  modelName,
                                  i);
        } else {
            toSet = getSanitizedId(segment.getId(), modelName);
        }
        segment.setId(toSet);
    }
@Test
    void populateCorrectSegmentId() throws Exception {
        final InputStream inputStream = getFileInputStream(NO_MODELNAME_NO_SEGMENTID_SAMPLE_NAME);
        final PMML pmml = org.jpmml.model.PMMLUtil.unmarshal(inputStream);
        final Model retrieved = pmml.getModels().get(0);
        assertThat(retrieved).isInstanceOf(MiningModel.class);
        MiningModel miningModel = (MiningModel) retrieved;
        Segment toPopulate = miningModel.getSegmentation().getSegments().get(0);
        assertThat(toPopulate.getId()).isNull();
        String modelName = "MODEL_NAME";
        int i = 0;
        KiePMMLUtil.populateCorrectSegmentId(toPopulate, modelName, i);
        assertThat(toPopulate.getId()).isNotNull();
        String expected = String.format(SEGMENTID_TEMPLATE,
                modelName,
                i);
        assertThat(toPopulate.getId()).isEqualTo(expected);
    }