int[] selectedIndeces=list.getSelectedIndices();
if(selectedIndeces.length == 0) return null;
if(selectedIndeces.length == 1) return list.getSelectedValue();
if(selectedIndeces.length > 1){
CompositeRole cr = new CompositeRole();
Object[] objRoles = list.getSelectedValues();
Role[] roleRoles = new Role[objRoles.length];
for(int i=0; i<objRoles.length; i++)
roleRoles[i] = (Role)objRoles[i];
cr.setRoles(roleRoles);
return cr;
}else{
return null;
}