public static DATA_TYPE getTargetFieldType(final List<Field<?>> fields, final Model model) {
        return getTargetFieldsTypeMap(fields, model).entrySet().iterator().next().getValue();
    }
@Test
    void getTargetFieldTypeWithTargetField() {
        final String fieldName = "fieldName";
        MiningField.UsageType usageType = MiningField.UsageType.PREDICTED;
        MiningField miningField = getMiningField(fieldName, usageType);
        final DataField dataField = getDataField(fieldName, OpType.CATEGORICAL, DataType.STRING);
        final DataDictionary dataDictionary = new DataDictionary();
        dataDictionary.addDataFields(dataField);
        final MiningSchema miningSchema = new MiningSchema();
        miningSchema.addMiningFields(miningField);
        final Model model = new RegressionModel();
        model.setMiningSchema(miningSchema);
        DATA_TYPE retrieved =
                org.kie.pmml.compiler.api.utils.ModelUtils.getTargetFieldType(getFieldsFromDataDictionary(dataDictionary), model);
        assertThat(retrieved).isNotNull();
        assertThat(retrieved).isEqualTo(DATA_TYPE.STRING);
    }