### Question:
ClientProjectDiagramService extends ClientDiagramServiceImpl<ProjectMetadata, ProjectDiagram, ProjectDiagramService> { public void create(final Path path, final String name, final String defSetId, final String projectName, final Package projectPkg, final Optional<String> projectType, final ServiceCallback<Path> callback) { diagramServiceCaller.call((RemoteCallback<Path>) callback::onSuccess, (message, throwable) -> { callback.onError(createOnErrorHandler(throwable, name, projectPkg)); return false; }).create(path, name, defSetId, projectName, projectPkg, projectType); } protected  ClientProjectDiagramService(); @Inject  ClientProjectDiagramService(final ShapeManager shapeManager,
                                       final SessionManager sessionManager,
                                       final Caller<ProjectDiagramService> diagramServiceCaller,
                                       final Caller<DiagramLookupService> diagramLookupServiceCaller,
                                       final Event<SessionDiagramSavedEvent> saveEvent); void create(final Path path,
                       final String name,
                       final String defSetId,
                       final String projectName,
                       final Package projectPkg,
                       final Optional<String> projectType,
                       final ServiceCallback<Path> callback); void saveOrUpdate(final Path path,
                             final ProjectDiagram diagram,
                             final Metadata metadata,
                             final String comment,
                             final ServiceCallback<ProjectDiagram> callback); void saveAsXml(final Path path,
                          final String xml,
                          final Metadata metadata,
                          final String comment,
                          final ServiceCallback<String> callback);  }### Answer:
@Test @SuppressWarnings("unchecked") public void testCreateWithProjectDetails() { final String name = "d1"; final String defSetId = "id1"; final String projName = "project-name"; final Package projPackage = mock(Package.class); final ServiceCallback<Path> callback = mock(ServiceCallback.class); final Optional<String> projectType = Optional.of("type"); tested.create(path, name, defSetId, projName, projPackage, projectType, callback); verify(diagramService, times(1)).create(eq(path), eq(name), eq(defSetId), eq(projName), eq(projPackage), eq(projectType)); verify(callback, times(1)).onSuccess(any(Path.class)); verify(callback, times(0)).onError(any(ClientRuntimeError.class)); }
@Test public void testDuplicatedBusinessProcess() { final String name = "d1"; final String defSetId = "id1"; final String projName = "project-name"; final Package projPackage = new Package(); final Optional<String> projectType = Optional.of("type"); ProjectDiagramService projectDiagramService = mock(ProjectDiagramService.class); doThrow(new FileAlreadyExistsException(path.toString())).when(projectDiagramService).create(path, name, defSetId, projName, projPackage, projectType); exception.expect(FileAlreadyExistsException.class); projectDiagramService.create(path, name, defSetId, projName, projPackage, projectType); }