boolean result = strategy.checkPossibleToEnrolInExistingGroup(grouping, studentGroup, studentGroup.getShift());
boolean result = strategy.checkPossibleToEnrolInExistingGroup(grouping, studentGroup);
    public Boolean run(Integer studentGroupCode, String username) throws FenixServiceException,            ExcepcaoPersistencia {        final ISuportePersistente persistentSupport = PersistenceSupportFactory                .getDefaultPersistenceSupport();        final IPersistentStudentGroup persistentStudentGroup = persistentSupport                .getIPersistentStudentGroup();        final IStudentGroup studentGroup = (IStudentGroup) persistentStudentGroup.readByOID(                StudentGroup.class, studentGroupCode);        if (studentGroup == null) {            throw new InvalidArgumentsServiceException();        }        final IStudent student = persistentSupport.getIPersistentStudent().readByUsername(username);        if (student == null) {            throw new InvalidArgumentsServiceException();        }        final IGrouping grouping = studentGroup.getGrouping();        final IAttends studentAttend = grouping.getStudentAttend(student);        if (studentAttend == null) {            throw new NotAuthorizedException();        }        if (studentGroup.getAttends().contains(studentAttend)) {            throw new InvalidSituationServiceException();        }        final IGroupEnrolmentStrategyFactory enrolmentGroupPolicyStrategyFactory = GroupEnrolmentStrategyFactory                .getInstance();        final IGroupEnrolmentStrategy strategy = enrolmentGroupPolicyStrategyFactory                .getGroupEnrolmentStrategyInstance(grouping);        boolean result = strategy.checkPossibleToEnrolInExistingGroup(grouping, studentGroup,                studentGroup.getShift());        if (!result) {            throw new InvalidArgumentsServiceException();        }        checkIfStudentIsNotEnrolledInOtherGroups(grouping.getStudentGroups(), studentGroup,                studentAttend);                studentGroup.addAttends(studentAttend);              return Boolean.TRUE;    }