if (p.getTeacher() != null
if (p.getTeacher() != null && p.getTeacher().getCurrentWorkingDepartment() != null
    private String getMostSignificantNumber(Person p, ParkingGroup parkingGroup) {        if (p.getParkingParty().getPhdNumber() != null) {            return "N: " + p.getParkingParty().getPhdNumber();        }        if (p.getTeacher() != null                && !p.getTeacher().isMonitor(ExecutionPeriod.readActualExecutionPeriod())) {            return "N Mec: " + p.getTeacher().getTeacherNumber();        }        if (p.getEmployee() != null && p.getEmployee().getCurrentWorkingContract() != null                && p.getTeacher() == null) {            return "N Mec: " + p.getEmployee().getEmployeeNumber();        }        if (p.getStudent() != null && !parkingGroup.getGroupName().equalsIgnoreCase("Bolseiros")) {            DegreeType degreeType = p.getStudent().getMostSignificantDegreeType();            Collection<Registration> registrations = p.getStudent().getRegistrationsByDegreeType(                    degreeType);            for (Registration registration : registrations) {                StudentCurricularPlan scp = registration.getActiveStudentCurricularPlan();                if (scp != null) {                    return "N: " + p.getStudent().getNumber();                }            }        }        if (p.getGrantOwner() != null && p.getGrantOwner().hasCurrentContract()) {            return "N: " + p.getGrantOwner().getNumber();        }        return "";    }