class PMMLMiningModelEvaluator implements PMMLModelEvaluator<KiePMMLMiningModel> {

    Object getEventuallyWeightedResult(Object rawObject, MULTIPLE_MODEL_METHOD multipleModelMethod,
                                               double weight) {
        switch (multipleModelMethod) {
            case MAJORITY_VOTE:
            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 MODEL_CHAIN:
            case WEIGHTED_MAJORITY_VOTE:
                throw new KiePMMLException(multipleModelMethod + " not implemented, yet");
            default:
                throw new KiePMMLException("Unrecognized MULTIPLE_MODEL_METHOD " + multipleModelMethod);
        }
    }

}