### Question:
CaseHelper { public void acceptContext(final Callback<Boolean, Void> callback) { projectContext.getActiveWorkspaceProject() .map(WorkspaceProject::getRootPath) .ifPresent(path -> bpmnDiagramService.call( projectType -> Optional.ofNullable(projectType) .filter(ProjectType.CASE::equals) .ifPresent(p -> callback.onSuccess(true))) .getProjectType(path)); } @Inject  CaseHelper(final Caller<BPMNDiagramService> bpmnDiagramService,
                      final WorkspaceProjectContext projectContext); void acceptContext(final Callback<Boolean, Void> callback);  }### Answer:
@Test public void acceptContext_true() { when(bpmnDiagramService.getProjectType(rootPath)).thenReturn(ProjectType.CASE); tested.acceptContext(callback); verify(bpmnDiagramService).getProjectType(rootPath); verify(callback).onSuccess(true); }
@Test public void acceptContext_false() { when(bpmnDiagramService.getProjectType(rootPath)).thenReturn(ProjectType.BPMN); tested.acceptContext(callback); verify(bpmnDiagramService).getProjectType(rootPath); verify(callback, never()).onSuccess(anyBoolean()); }