public Object evaluateReasonCodeValue(final ProcessingDTO processingDTO) {
        final List<String> orderedReasonCodes = processingDTO.getOrderedReasonCodes();
        if (rank != null) {
            int index = rank - 1;
            String resultCode = null;
            if (index < orderedReasonCodes.size()) {
                resultCode = orderedReasonCodes.get(index);
            }
            return commonEvaluate(resultCode, dataType);
        } else {
            return null;
        }
    }
@Test
    void evaluateReasonCodeValue() {
        KiePMMLOutputField kiePMMLOutputField = KiePMMLOutputField.builder("outputfield", Collections.emptyList())
                .withResultFeature(RESULT_FEATURE.REASON_CODE)
                .withRank(4)
                .build();
        final List<String> reasonCodes = IntStream.range(0, 3).mapToObj(i ->
                                                                                "reasonCode-" + i)
                .collect(Collectors.toList());
        ProcessingDTO processingDTO = getProcessingDTO(Collections.emptyList(), Collections.emptyList(), reasonCodes);
        assertThat(kiePMMLOutputField.evaluate(processingDTO)).isNull();
        final String variableValue = "reasonCode-3";
        reasonCodes.add(variableValue);
        processingDTO = getProcessingDTO(Collections.emptyList(), Collections.emptyList(), reasonCodes);
        Object retrieved = kiePMMLOutputField.evaluate(processingDTO);
        assertThat(retrieved).isNotNull();
        assertThat(retrieved).isEqualTo(variableValue);
    }