Object getEventuallyWeightedResult(Object rawObject, MULTIPLE_MODEL_METHOD multipleModelMethod,
                                       double weight) {
        switch (multipleModelMethod) {
            case MAJORITY_VOTE:
            case MODEL_CHAIN:
            case SELECT_ALL:
            case SELECT_FIRST:
                return rawObject;
            case MAX:
            case SUM:
            case MEDIAN:
            case AVERAGE:
            case WEIGHTED_SUM:
            case WEIGHTED_MEDIAN:
            case WEIGHTED_AVERAGE:
                if (!(rawObject instanceof Number)) {
                    throw new KiePMMLException("Expected a number, retrieved " + rawObject.getClass().getName());
                }
                return new KiePMMLValueWeight(((Number) rawObject).doubleValue(), weight);
            case WEIGHTED_MAJORITY_VOTE:
                throw new KiePMMLException(multipleModelMethod + " not implemented, yet");
            default:
                throw new KiePMMLException("Unrecognized MULTIPLE_MODEL_METHOD " + multipleModelMethod);
        }
    }
@Test
    void getEventuallyWeightedResultValueWeightNumber() {
        final Integer rawObject = 24;
        final double weight = 2.23;
        VALUE_WEIGHT_METHODS.forEach(multipleModelMethod -> {
            Object retrieved = evaluator.getEventuallyWeightedResult(rawObject, multipleModelMethod, weight);
            assertThat(retrieved).isNotNull();
            assertThat(retrieved).isInstanceOf(KiePMMLValueWeight.class);
            KiePMMLValueWeight kiePMMLValueWeight = (KiePMMLValueWeight) retrieved;
            assertThat(kiePMMLValueWeight.getValue()).isCloseTo(rawObject.doubleValue(), Offset.offset(0.0));
            assertThat(kiePMMLValueWeight.getWeight()).isCloseTo(weight, Offset.offset(0.0));
        });
    }