CaseRolesPresenter extends AbstractCaseInstancePresenter<CaseRolesPresenter.CaseRolesView> { protected void removeUserFromRole(final String userName, final CaseRoleAssignmentSummary caseRoleAssignmentSummary) { caseService.call( (Void) -> { List<String> users = caseRoleAssignmentSummary.getUsers(); users.remove(userName); caseRoleAssignmentSummary.setUsers(users); filterCaseRoles(); } ).removeUserFromRole(containerId, caseId, caseRoleAssignmentSummary.getName(), userName); }  @WorkbenchPartTitle String getTittle(); void filterCaseRoles(); void setCaseRoleActions(CaseRoleItemView caseRole); void setCaseRoleAssignments(CaseRoleItemView caseRole,
                                       final int assignmentsListMaxWidth); void storeRoleAssignments(final CaseRoleAssignmentSummary currentRoleAssignments,
                                     List<String> users,
                                     List<String> groups); static final String SCREEN_ID; static final String CASE_OWNER_ROLE; }
@Test public void testRemoveUserFromRole() { List<String> assignedUsersList = new ArrayList<>(); assignedUsersList.add(USER); final CaseRoleAssignmentSummary roleAssignments = CaseRoleAssignmentSummary.builder() .name(CASE_ROLE) .users(assignedUsersList) .build(); when(view.getFilterValue()).thenReturn("All"); presenter.removeUserFromRole(USER, roleAssignments); verify(caseManagementService).removeUserFromRole(anyString(), anyString(), eq(CASE_ROLE), eq(USER)); assertTrue(roleAssignments.getUsers().isEmpty()); verify(presenter).filterCaseRoles(); }