static SerializableFunction<Map<String, Object>, Double> getPredictorTermSerializableFunction(final PredictorTerm predictorTerm) {
        return resultMap -> {
            final AtomicReference<Double> result = new AtomicReference<>(1.0);
            final List<String> fieldRefs = predictorTerm.getFieldRefs().stream()
                    .map(fieldRef ->fieldRef.getField())
                    .collect(Collectors.toList());
            for (Map.Entry<String, Object> entry : resultMap.entrySet()) {
                if (fieldRefs.contains(entry.getKey())) {
                    result.set(result.get() * (Double) entry.getValue());
                }
            }
            return result.get() * predictorTerm.getCoefficient().doubleValue();
        };
    }
@Test
    void getPredictorTermSerializableFunction() {
        String predictorName = "predictorName";
        double coefficient = 23.12;
        String fieldRef = "fieldRef";
        PredictorTerm predictorTerm = PMMLModelTestUtils.getPredictorTerm(predictorName, coefficient,
                Collections.singletonList(fieldRef));
        SerializableFunction<Map<String, Object>, Double> retrieved =
                KiePMMLRegressionTableFactory.getPredictorTermSerializableFunction(predictorTerm);
        assertThat(retrieved).isNotNull();
    }