### Question:
ProjectScreen { public void rename() { projectController.canUpdateProject(workspaceProject).then(userCanUpdateProject -> { if (userCanUpdateProject) { final RenameProjectPopUpScreen popUp = renameProjectPopUpScreen.get(); popUp.show(this.workspaceProject); } return promises.resolve(); }); } @Inject  ProjectScreen(final View view,
                         final LibraryPlaces libraryPlaces,
                         final AssetsScreen assetsScreen,
                         final ChangeRequestListPresenter changeRequestsScreen,
                         final ContributorsListPresenter contributorsListScreen,
                         final ProjectMetricsScreen projectMetricsScreen,
                         final ProjectController projectController,
                         final SettingsPresenter settingsPresenter,
                         final NewFileUploader newFileUploader,
                         final NewResourcePresenter newResourcePresenter,
                         final ManagedInstance<DeleteProjectPopUpScreen> deleteProjectPopUpScreen,
                         final ManagedInstance<DeleteBranchPopUpScreen> deleteBranchPopUpScreen,
                         final ManagedInstance<RenameProjectPopUpScreen> renameProjectPopUpScreen,
                         final Caller<LibraryService> libraryService,
                         final Caller<ProjectScreenService> projectScreenService,
                         final CopyPopUpPresenter copyPopUpPresenter,
                         final ProjectNameValidator projectNameValidator,
                         final Promises promises,
                         final Event<NotificationEvent> notificationEvent,
                         final ProjectContributorsListServiceImpl projectContributorsListService,
                         final ProjectMainActions projectMainActions); @PostConstruct void initialize(); @OnMayClose boolean onMayClose(); void setAssetsCount(Integer assetsCount); void setChangeRequestsCount(final Integer openChangeRequestsCount); void onAddAsset(@Observes NewResourceSuccessEvent event); void onChangeRequestListUpdated(@Observes final ChangeRequestListUpdatedEvent event); void onChangeRequestStatusUpdated(@Observes final ChangeRequestStatusUpdatedEvent event); void onAssetsUpdated(@Observes UpdatedAssetsEvent event); void onRepositoryContributorsUpdated(@Observes final RepositoryContributorsUpdatedEvent repositoryUpdatedEvent); void changeProjectAndTitleWhenContextChange(@Observes final WorkspaceProjectContextChangeEvent current); void showAssets(); void showChangeRequests(); void showMetrics(); void showContributors(); @WorkbenchPartTitle String getTitle(); void deleteProject(); void deleteBranch(); void submitChangeRequest(); void addAsset(); void importAsset(); void showSettings(); void rename(); void duplicate(); void reimport(); boolean userCanDeleteProject(); boolean userCanCreateProjects(); @WorkbenchPartView ProjectScreen.View getView();  }### Answer:
@Test public void testRename() { { doReturn(promises.resolve(false)).when(this.projectController).canUpdateProject(any()); this.presenter.rename(); verify(this.renameProjectPopUpScreen, never()).show(any()); } { doReturn(promises.resolve(true)).when(this.projectController).canUpdateProject(any()); this.presenter.rename(); verify(this.renameProjectPopUpScreen, times(1)).show(any()); } }