@SuppressWarnings("unchecked")
    public static KiePMMLModelFactory loadKiePMMLModelFactory(ModelLocalUriId modelLocalUriId,
                                                              PMMLContext pmmlContext) {
        Optional<GeneratedExecutableResource> generatedExecutableResource = getGeneratedExecutableResource(modelLocalUriId, pmmlContext.getGeneratedResourcesMap());
        if (generatedExecutableResource.isPresent()) {
            return loadKiePMMLModelFactory(generatedExecutableResource.get(), pmmlContext);
        } else {
            throw new KieRuntimeServiceException("Can not find expected GeneratedExecutableResource " +
                                                             "for " + modelLocalUriId);
        }
    }
@Test
    void loadKiePMMLModelFactory() {
        KiePMMLModelFactory retrieved = PMMLLoaderUtils.loadKiePMMLModelFactory(new ModelLocalUriId(LocalUri.parse("/" + PMML_STRING +
                                                                                                       "/" + basePath)),
                                                                                getPMMLContext(FILE_NAME, MODEL_NAME));
        assertThat(retrieved).isNotNull();
        assertThat(retrieved.getKiePMMLModels()).hasSize(1);
        KiePMMLModel kiePmmlModel = retrieved.getKiePMMLModels().get(0);
        assertThat(kiePmmlModel.getName()).isEqualTo(MODEL_NAME);
    }