static void executeTargets(final PMML4Result toModify, final ProcessingDTO processingDTO) {
        logger.debug("executeTargets {} {}", toModify, processingDTO);
        if (!toModify.getResultCode().equals(OK.getName())) {
            return;
        }
        final String targetFieldName = toModify.getResultObjectName();
        final Map<String, Object> resultVariables = toModify.getResultVariables();
        processingDTO.getKiePMMLTargets()
                .stream()
                .filter(kiePMMLTarget -> kiePMMLTarget.getField() != null && kiePMMLTarget.getField().equals(targetFieldName))
                .findFirst()
                .ifPresent(kiePMMLTarget -> {
                    Object prediction = resultVariables.get(targetFieldName);
                    logger.debug("Original prediction {}", prediction);
                    Object modifiedPrediction = kiePMMLTarget.modifyPrediction(resultVariables.get(targetFieldName));
                    logger.debug("Modified prediction {}", modifiedPrediction);
                    resultVariables.put(targetFieldName, modifiedPrediction);
                });
    }
@Test
    void executeTargets() {
        // Build model
        String TARGET_NAME = "TARGET_NAME";
        String FIELD_NAME = "FIELD_NAME";
        TargetField targetField = new TargetField(Collections.emptyList(), null, FIELD_NAME, null, 4.34, null, null,
                null);
        KiePMMLTarget kiePMMLTarget = KiePMMLTarget.builder(TARGET_NAME, Collections.emptyList(), targetField)
                .build();
        List<KiePMMLTarget> kiePMMLTargets = Arrays.asList(kiePMMLTarget, KiePMMLTarget.builder("NEW_TARGET",
                Collections.emptyList(),
                new TargetField(Collections.emptyList(), null, "NEW_TARGET", null, null, null, null,
                        null)).build());
        KiePMMLTestingModel model = KiePMMLTestingModel.builder("FILENAME", "TESTINGMODEL", Collections.emptyList(),
                MINING_FUNCTION.REGRESSION)
                .withKiePMMLTargets(kiePMMLTargets)
                .build();
        // Build PMML4Result
        PMML4Result toModify = new PMML4Result();
        toModify.setResultCode(ResultCode.FAIL.getName());
        toModify.addResultVariable(FIELD_NAME, 4.33);
        assertThat(toModify.getResultVariables().get(FIELD_NAME)).isEqualTo(4.33);
        ProcessingDTO processingDTO = getProcessingDTO(model, new ArrayList<>());
        PostProcess.executeTargets(toModify, processingDTO);
        assertThat(toModify.getResultVariables().get(FIELD_NAME)).isEqualTo(4.33);
        toModify.setResultCode(ResultCode.OK.getName());
        PostProcess.executeTargets(toModify, processingDTO);
        assertThat(toModify.getResultVariables().get(FIELD_NAME)).isEqualTo(4.33);
        toModify.setResultObjectName(FIELD_NAME);
        PostProcess.executeTargets(toModify, processingDTO);
        assertThat(toModify.getResultVariables().get(FIELD_NAME)).isEqualTo(4.34);
    }