final ISuportePersistente persistentSupport = PersistenceSupportFactory .getDefaultPersistenceSupport(); final IStudent student = persistentSupport.getIPersistentStudent().readByUsername( studentUsername); final IAttends studentAttend = grouping.getStudentAttend(student);
final IAttends studentAttend = grouping.getStudentAttend(studentUsername);
    public boolean checkNotEnroledInGroup(IGrouping grouping, IStudentGroup studentGroup,            String studentUsername) throws ExcepcaoPersistencia {        final ISuportePersistente persistentSupport = PersistenceSupportFactory                .getDefaultPersistenceSupport();        final IStudent student = persistentSupport.getIPersistentStudent().readByUsername(                studentUsername);        final IAttends studentAttend = grouping.getStudentAttend(student);        if (studentAttend != null) {            List<IAttends> studentGroupAttends = studentGroup.getAttends();            for (final IAttends attend : studentGroupAttends) {                if (attend == studentAttend) {                    return false;                }            }        }        return true;    }