@Test
public void populateWithOutputFields() {

    model = KiePMMLScorecardModel.builder(MODEL_NAME, Collections.emptyList(), MINING_FUNCTION.REGRESSION)
            .withOutputFields(outputFields)
            .withOutputFieldsMap(outputFieldsMap)
            .build();
    PMML4Result toPopulate = new PMML4Result();
    model.populateWithOutputFields(toPopulate);
    assertFalse(toPopulate.getResultVariables().isEmpty());
    for (int i = outputFields.size() -1; i == 0; i --) {
        KiePMMLOutputField outputField = outputFields.get(i);
        assertTrue(toPopulate.getResultVariables().containsKey(outputField.getName()));
        // This test works as it is because relationship outputFields rank and outputFieldsMap is made in reverse order
        assertEquals("REASON_CODE_" + i, toPopulate.getResultVariables().get(outputField.getName()));
    }
}