class PMMLLoaderService {

    static void loadPMMLRuleMappers(final KnowledgeBuilderImpl kbuilderImpl,
                                    final List<PMMLRuleMapper> pmmlRuleMappers) {
        if (!pmmlRuleMappers.isEmpty()) {
            List<Model> models =
                    pmmlRuleMappers.stream()
                            .map(PMMLRuleMapper::getModel)
                            .collect(Collectors.toList());
            KnowledgeBuilderImpl temp = new KnowledgeBuilderImpl(KieBaseBuilder.createKieBaseFromModel(models));
            for (KiePackage kiePackage : temp.getKnowledgeBase().getKiePackages()) {
                kbuilderImpl.addPackage((InternalKnowledgePackage) kiePackage);
            }
        }
    }

    private  PMMLLoaderService();

}