protected void validate(final List<Field<?>> fields, final RegressionModel toValidate) {
        if (toValidate.getRegressionTables() == null || toValidate.getRegressionTables().isEmpty()) {
            throw new KiePMMLException("At least one RegressionTable required");
        }
        if (isRegression(toValidate)) {
            List<KiePMMLNameOpType> targetFields = getTargetFields(fields, toValidate);
            validateRegression(targetFields, toValidate);
        } else {
            validateClassification(fields, toValidate);
        }
    }
@Test
    void validateNoRegressionTables() throws Exception {
        final PMML pmml = TestUtils.loadFromFile(SOURCE_1);
        assertThat(pmml).isNotNull();
        assertThat(pmml.getModels()).hasSize(1);
        assertThat(pmml.getModels().get(0)).isInstanceOf(RegressionModel.class);
        RegressionModel regressionModel = (RegressionModel) pmml.getModels().get(0);
        regressionModel.getRegressionTables().clear();
        final List<Field<?>> fields = getFieldsFromDataDictionary(pmml.getDataDictionary());
        try {
            PROVIDER.validate(fields, regressionModel);
            fail("Expecting validation failure due to missing RegressionTables");
        } catch (KiePMMLException e) {
            // Expected
        }
        regressionModel = new RegressionModel(regressionModel.getMiningFunction(), regressionModel.getMiningSchema(),
                null);
        try {
            PROVIDER.validate(fields, regressionModel);
            fail("Expecting validation failure due to missing RegressionTables");
        } catch (KiePMMLException e) {
            // Expected
        }
    }