### Question:
ProjectDependencyServiceImpl implements ProjectDependencyService { @Override public List<RepoWidgetList> findAllWidgets(Integer projectId) { List<ProjectDependency> allDependences = projectDependencyDao.findAllByProjectId(projectId); return allDependences .stream() .flatMap(item -> componentRepoVersionDao.findById(item.getComponentRepoVersionId()).stream()) .map(item -> item.getApiRepoVersionId()) .distinct() .map(apiVersionId -> { Optional<ApiRepo> apiRepoOption = apiRepoVersionDao .findById(apiVersionId) .flatMap(apiRepoVersion -> apiRepoDao.findById(apiRepoVersion.getApiRepoId())); ApiRepoVersionInfo result = new ApiRepoVersionInfo(); result.setApiRepoVersionId(apiVersionId); apiRepoOption.ifPresent(apiRepo -> { result.setApiRepoName(apiRepo.getGitRepoUrl()); result.setApiRepoId(apiRepo.getId()); result.setCategory(apiRepo.getCategory()); }); return result; }) .filter(apiVersionInfo -> apiVersionInfo.getCategory() == RepoCategory.WIDGET) .map(apiVersionInfo -> { List<Widget> widgets = apiComponentDao .findAllByApiRepoVersionId(apiVersionInfo.getApiRepoVersionId()) .stream() .map(apiComponent -> { Widget result = new Widget(); result.setWidgetId(apiComponent.getId()); result.setWidgetCode(apiComponent.getCode()); result.setWidgetName(apiComponent.getName()); result.setApiRepoId(apiVersionInfo.getApiRepoId()); List<WidgetProperty> properties = apiComponentAttrDao.findAllByApiWidgetIdOrderByCode(apiComponent.getId()).stream().map(property -> { WidgetProperty each = new WidgetProperty(); each.setCode(property.getCode()); each.setName(property.getName()); each.setValueType(property.getValueType()); each.setDefaultValue(property.getDefaultValue()); if(property.getValueType().equals(WidgetPropertyValueType.FUNCTION.getKey())) { List<EventArgument> eventArgs = apiComponentAttrFunArgDao.findAllByApiWidgetPropertyId(property.getId()).stream().map(eventArg -> { EventArgument ea = new EventArgument(); ea.setCode(eventArg.getCode()); ea.setName(eventArg.getName()); ea.setValueType(eventArg.getValueType()); ea.setDefaultValue(eventArg.getDefaultValue()); return ea; }).collect(Collectors.toList()); each.setArguments(eventArgs); } return each; }).collect(Collectors.toList()); result.setProperties(properties); return result; }).collect(Collectors.toList()); WidgetCategory category = new WidgetCategory(); category.setName("_"); category.setWidgets(widgets); RepoWidgetList widgetRepo = new RepoWidgetList(); widgetRepo.setApiRepoId(apiVersionInfo.getApiRepoId()); widgetRepo.setApiRepoName(apiVersionInfo.getApiRepoName()); widgetRepo.setWidgetCategories(Collections.singletonList(category)); return widgetRepo; }).collect(Collectors.toList()); }  @Override Boolean devDependencyExists(Integer projectId, Integer componentRepoId); @Override Boolean buildDependencyExists(Integer projectId, Integer buildProfileId, Integer componentRepoId); @Override ProjectDependency save(Repository repository, RepositoryResource project, ProjectDependency dependency); @Override void delete(Repository repository, RepositoryResource project, Integer dependenceId); @Override ProjectDependency update(Repository repository, RepositoryResource project, ProjectDependency dependency); @Override Optional<ProjectDependency> findById(Integer dependenceId); @Override List<RepoWidgetList> findAllWidgets(Integer projectId); @Override List<ProjectDependencyData> findAllConfigDependencies(Integer projectId); @Override List<ProjectDependencyData> findDevDependencies(Integer projectId); @Override List<ProjectDependencyData> findStdDevDependencies(AppType appType); @Override List<ProjectDependencyData> findStdBuildDependencies(AppType appType); @Override List<ProjectDependency> findAllDevDependencies(Integer projectId, AppType appType);  }### Answer:
@Test public void findAllWidgetsNoData() { Integer projectId = 1; List<RepoWidgetList> result = projectDependencyService.findAllWidgets(projectId); assertThat(result).isEmpty(); }