if (teacher.getKeyContract().equals(contractId)
if (teacher.getKeyGrantContract().equals(contractId)
    public GrantOrientationTeacher readActualGrantOrientationTeacherByContract(Integer contractId,            Integer idInternal) throws ExcepcaoPersistencia {        List<GrantOrientationTeacher> grantOrientationTeachers = (List<GrantOrientationTeacher>) readAll(GrantOrientationTeacher.class);        GrantOrientationTeacher result = null;        for (GrantOrientationTeacher teacher : grantOrientationTeachers) {            if (teacher.getKeyContract().equals(contractId)                    && !teacher.getIdInternal().equals(idInternal)                    && (result == null || result.getBeginDate().getTime() < teacher.getBeginDate()                            .getTime())) {                result = teacher;            }        }                return result;    }