if (!existingStudent.getPerson().equals(person)) { throw new ExistingServiceException(); } }
if (existingStudent != null && !existingStudent.getPerson().equals(person)) { throw new ExistingServiceException(); } }
    private void checkOldStudentNumber(Integer studentNumber, Person person)            throws ExcepcaoPersistencia, ExistingServiceException {        if (studentNumber != null) {            Registration existingStudent = Registration.readStudentByNumberAndDegreeType(studentNumber,                    DegreeType.MASTER_DEGREE);            if (!existingStudent.getPerson().equals(person)) {                throw new ExistingServiceException();            }        }    }