if (evaluation instanceof Exam){
if (evaluation instanceof IExam){
    public List readByRoomAndExecutionPeriod(String roomName, String executionPeriodName, String year)            throws ExcepcaoPersistencia {        List<IExecutionYear> executionYears = (List<IExecutionYear>) readAll(ExecutionYear.class);        IExecutionYear executionYearResult = null;        IExecutionPeriod executionPeriodResult = null;        for (IExecutionYear executionYear : executionYears) {            if (executionYear.getYear().equals(year)) {                executionYearResult = executionYear;                break;            }        }        List<IExecutionPeriod> executionPeriods = executionYearResult.getExecutionPeriods();        for (IExecutionPeriod executionPeriod : executionPeriods) {            if (executionPeriod.getName().equalsIgnoreCase(executionPeriodName)) {                executionPeriodResult = executionPeriod;                break;            }        }        List<IExecutionCourse> executionCourses = executionPeriodResult.getAssociatedExecutionCourses();        List<IExam> result = new ArrayList();        HashSet hashSet = new HashSet(75);        for (IExecutionCourse executionCourse : executionCourses) {            List<IExam> exams = new ArrayList();            List<IEvaluation> associatedEvaluations = executionCourse.getAssociatedEvaluations();            for(IEvaluation evaluation : associatedEvaluations){                if (evaluation instanceof Exam){                    exams.add((IExam) evaluation);                }            }            for (IExam exam : exams) {                List<IRoom> rooms = exam.getAssociatedRooms();                for (IRoom room : rooms) {                    if (room.getNome().equalsIgnoreCase(roomName)) {                        if (!hashSet.contains(exam.getIdInternal())) {                            result.add(exam);                            hashSet.add(exam.getIdInternal());                        }                    }                }            }        }        return result;    }