public void assignRoles( List<Object> rolesToAssign ) {
    List<UIRepositoryObjectAcl> acls = new ArrayList<UIRepositoryObjectAcl>();
    for ( Object role : rolesToAssign ) {
      if ( role instanceof String ) {
        String roleToAssign = (String) role;
        acls.add( assignRole( roleToAssign ) );
      }
    }
    this.firePropertyChange( "selectedRoleList", null, getSelectedRoleList() ); //$NON-NLS-1$
    setSelectedAssignedRoles( acls );
    setSelectedAvailableRoles( new ArrayList<String>() );
  }
@Test
  public void testAssignRoles() {
    UIRepositoryObjectAcl selectedRoleAcl = new UIRepositoryObjectAcl( createRoleAce( ROLE1 ) );
    repositoryObjectAcls.addAcl( selectedRoleAcl );
    repositoryObjectAclModel.setAclsList( null, defaultRoleNameList );

    List<Object> objectRoleList = Arrays.asList( new Object[] { ROLE2 } );
    repositoryObjectAclModel.assignRoles( objectRoleList );
    assertStringListMatches( Arrays.asList( new String[] { ROLE3 } ), repositoryObjectAclModel.getAvailableRoleList() );
    assertNameToAclListMatches( Arrays.asList( new String[] { ROLE2 } ), repositoryObjectAclModel
        .getSelectedAssignedRoles() );
    assertNameToAclListMatches( Arrays.asList( new String[] { ROLE2 } ), repositoryObjectAclModel.getAclsToAdd() );

    repositoryObjectAclModel.updateSelectedAcls();
    assertNameToAclListMatches( Arrays.asList( new String[] { ROLE1, ROLE2 } ), repositoryObjectAclModel
        .getSelectedAcls().getAcls() );
    // For some reason, updateSelectedAcls does not clear aclsToAdd. After the update ROLE2 is still present in
    // the aclsToAdd list. This probably is not an issue because the interface reloads. For now, I will clear
    // manually now so I can exercise some unassign code.
    repositoryObjectAclModel.getAclsToAdd().clear();

    // Unassign the pending ROLE2 and the pre-assigned ROLE1
    UIRepositoryObjectAcl role2Acl = repositoryObjectAclModel.getSelectedRole( 1 );
    repositoryObjectAclModel.unassign( Arrays.asList( new Object[] { role2Acl, selectedRoleAcl } ) );

    assertEquals( 0, repositoryObjectAclModel.getSelectedAssignedRoles().size() );
    assertStringListMatches( defaultRoleNameList, repositoryObjectAclModel.getAvailableRoleList() );

    repositoryObjectAclModel.updateSelectedAcls();
    assertEquals( 0, repositoryObjectAclModel.getSelectedAcls().getAcls().size() );
  }