Integer selection[] = (Integer[]) arguments[0];
Set<Integer> selection = (Set<Integer>) arguments[0];
    private boolean hasPrivilege(IUserView id, Object[] arguments) throws ExcepcaoPersistencia {        List roles = getRoleList(id.getRoles());        CollectionUtils.intersection(roles, getNeededRoles());        ISuportePersistente sp = PersistenceSupportFactory.getDefaultPersistenceSupport();        List roleTemp = new ArrayList();        roleTemp.add(RoleType.MASTER_DEGREE_ADMINISTRATIVE_OFFICE);        if (CollectionUtils.containsAny(roles, roleTemp)) {            return true;        }        roleTemp = new ArrayList();        roleTemp.add(RoleType.COORDINATOR);        if (CollectionUtils.containsAny(roles, roleTemp)) {            ITeacher teacher = null;            // Read The ExecutionDegree            try {                Integer selection[] = (Integer[]) arguments[0];                Integer candidateID = (Integer) arguments[1];                teacher = sp.getIPersistentTeacher().readTeacherByUsername(id.getUtilizador());                IMasterDegreeCandidate masterDegreeCandidate = (IMasterDegreeCandidate) sp                        .getIPersistentMasterDegreeCandidate().readByOID(MasterDegreeCandidate.class,                                candidateID);                if (masterDegreeCandidate == null) {                    return false;                }                //modified by Tnia Pouso                ICoordinator coordinator = sp.getIPersistentCoordinator()                        .readCoordinatorByTeacherIdAndExecutionDegreeId(teacher.getIdInternal(),                                masterDegreeCandidate.getExecutionDegree().getIdInternal());                if (coordinator == null) {                    return false;                }                for (int i = 0; i < selection.length; i++) {                    // Modified by Fernanda Quitrio                    ICurricularCourse curricularCourse = (ICurricularCourse) sp                            .getIPersistentCurricularCourse().readByOID(CurricularCourse.class,                                    selection[i]);                    if (!curricularCourse.getDegreeCurricularPlan().equals(                            masterDegreeCandidate.getExecutionDegree().getDegreeCurricularPlan())) {                        return false;                    }                }                return true;            } catch (Exception e) {                return false;            }        }        return true;    }