### Question:
ProjectImportsServiceImpl extends KieService<ProjectImportsContent> implements ProjectImportsService { public void saveProjectImports(final Path path) { if (ioService.exists(Paths.convert(path))) { throw new FileAlreadyExistsException(path.toString()); } else { ioService.write(Paths.convert(path), projectConfigurationContentHandler.toString(createProjectImports())); } } ProjectImportsServiceImpl(); @Inject  ProjectImportsServiceImpl(final @Named("ioStrategy") IOService ioService,
                                     final ProjectConfigurationContentHandler projectConfigurationContentHandler,
                                     final RenameService renameService,
                                     final SaveAndRenameServiceImpl<ProjectImports, Metadata> saveAndRenameService); @PostConstruct void init(); void saveProjectImports(final Path path); @Override ProjectImportsContent loadContent(Path path); @Override ProjectImports load(final Path path); @Override Path save(final Path resource,
                     final ProjectImports projectImports,
                     final Metadata metadata,
                     final String comment); @Override Path rename(final Path path,
                       final String newName,
                       final String comment); @Override Path saveAndRename(final Path path,
                              final String newFileName,
                              final Metadata metadata,
                              final ProjectImports content,
                              final String comment);  }### Answer:
@Test public void testPackageNameWhiteList() throws URISyntaxException { when(ioService.exists(any(org.uberfire.java.nio.file.Path.class))).thenReturn(false); projectImportsService.saveProjectImports(pathToImports); verify(ioService).write(any(org.uberfire.java.nio.file.Path.class), importsArgumentCaptor.capture()); assertExternalDataObjects(importsArgumentCaptor.getValue()); }
@Test(expected = FileAlreadyExistsException.class) public void testPackageNameWhiteListFileExists() throws URISyntaxException { when(ioService.exists(any(org.uberfire.java.nio.file.Path.class))).thenReturn(true); projectImportsService.saveProjectImports(pathToImports); }