PMMLCompilerService { static String getFileName(final String fullPath) { String toReturn = fullPath; if (fullPath.contains(File.separator)) { toReturn = fullPath.substring(fullPath.lastIndexOf(File.separator) + 1); } else if (fullPath.contains("/")) { toReturn = fullPath.substring(fullPath.lastIndexOf('/') + 1); } return toReturn; } private  PMMLCompilerService(); static List<KiePMMLModel> getKiePMMLModelsFromResourcesWithConfigurationsFromPlugin(KnowledgeBuilderImpl kbuilderImpl, Collection<ResourceWithConfiguration> resourceWithConfigurations); static List<KiePMMLModel> getKiePMMLModelsCompiledFromResourcesWithConfigurations(KnowledgeBuilderImpl kbuilderImpl, Collection<ResourceWithConfiguration> resourceWithConfigurations); static List<KiePMMLModel> getKiePMMLModelsCompiledFromResource(KnowledgeBuilderImpl kbuilderImpl,
                                                                          Resource resource); static List<KiePMMLModel> getKiePMMLModelsFromResourceFromPlugin(KnowledgeBuilderImpl kbuilderImpl,
                                                                            Resource resource);  }
@Test public void getFileName() { String fileName = "TestFile.pmml"; String fullPath = String.format("%1$sthis%1$sis%1$sfull%1$spath%1$s%2$s", File.separator, fileName); String retrieved = PMMLCompilerService.getFileName(fullPath); assertEquals(fileName, retrieved); fullPath = String.format("%1$sthis%1$sis%1$sfull%1$spath%1$s%2$s", "/", fileName); retrieved = PMMLCompilerService.getFileName(fullPath); assertEquals(fileName, retrieved); }