### Question:
SubmitChangeRequestScreenPresenter { public void updateDiffContainer() { busyIndicatorView.showBusyIndicator(ts.getTranslation(LibraryConstants.Loading)); changeRequestService.call((final List<ChangeRequestDiff> diffList) -> { boolean hideDiff = diffList.isEmpty(); if (hideDiff) { setupEmptyDiffList(); } else { setupPopulatedDiffList(diffList); } view.showDiff(!hideDiff); busyIndicatorView.hideBusyIndicator(); }, new HasBusyIndicatorDefaultErrorCallback(busyIndicatorView)) .getDiff(workspaceProject.getSpace().getName(), workspaceProject.getRepository().getAlias(), currentBranchName, selectedBranch); } @Inject  SubmitChangeRequestScreenPresenter(final View view,
                                              final TranslationService ts,
                                              final LibraryPlaces libraryPlaces,
                                              final ManagedInstance<DiffItemPresenter> diffItemPresenterInstances,
                                              final Caller<ChangeRequestService> changeRequestService,
                                              final ProjectController projectController,
                                              final Promises promises,
                                              final BusyIndicatorView busyIndicatorView,
                                              final ChangeRequestUtils changeRequestUtils,
                                              final Event<NotificationEvent> notificationEvent); @PostConstruct void postConstruct(); @WorkbenchPartTitle String getTitle(); @WorkbenchPartView View getView(); @OnClose void onClose(); void refreshOnFocus(@Observes final SelectPlaceEvent selectPlaceEvent); void onRepositoryFileListUpdated(@Observes final RepositoryFileListUpdatedEvent event); void cancel(); void submit(); void selectBranch(final String branchName); void updateDiffContainer();  }### Answer:
@Test public void updateDiffListWhenEmptyTest() throws NoSuchFieldException { new FieldSetter(presenter, SubmitChangeRequestScreenPresenter.class.getDeclaredField("workspaceProject")) .set(workspaceProject); doReturn(Collections.emptyList()).when(changeRequestService).getDiff(anyString(), anyString(), anyString(), anyString()); presenter.updateDiffContainer(); verify(view).clearDiffList(); verify(view, never()).addDiffItem(any(), any()); verify(changeRequestService).getDiff(anyString(), anyString(), anyString(), anyString()); verify(view).enableSubmitButton(false); }
@Test public void updateDiffListWhenPopulatedTest() throws NoSuchFieldException { new FieldSetter(presenter, SubmitChangeRequestScreenPresenter.class.getDeclaredField("workspaceProject")) .set(workspaceProject); ChangeRequestDiff crDiff = mock(ChangeRequestDiff.class); doReturn(10).when(crDiff).getDeletedLinesCount(); doReturn(10).when(crDiff).getAddedLinesCount(); List<ChangeRequestDiff> diffList = Collections.nCopies(5, crDiff); doReturn(diffList).when(changeRequestService).getDiff(anyString(), anyString(), anyString(), anyString()); presenter.updateDiffContainer(); verify(view).clearDiffList(); verify(view, times(diffList.size())).addDiffItem(any(), any()); verify(changeRequestService).getDiff(anyString(), anyString(), anyString(), anyString()); verify(view).enableSubmitButton(true); verify(view).showDiff(true); }