throw new DomainException("error.person.addingInvalidRole", RoleType.ALUMNI.getName());
return null;
    public static String generateNewUsername(RoleType roleType, Person person) {	if (roleType.equals(RoleType.TEACHER)) {	    if (person.getTeacher() != null) {		return "D" + person.getTeacher().getTeacherNumber();	    } else {		throw new DomainException("error.person.addingInvalidRole", RoleType.TEACHER.getName());	    }		} else if (roleType.equals(RoleType.EMPLOYEE)) {	    if (person.getEmployee() != null) {		return "F" + person.getEmployee().getEmployeeNumber();	    } else {		throw new DomainException("error.person.addingInvalidRole", RoleType.EMPLOYEE.getName());	    }		} else if (roleType.equals(RoleType.STUDENT)) {	    Registration registration = person		    .getStudentByType(DegreeType.BOLONHA_ADVANCED_FORMATION_DIPLOMA);	    if (registration != null) {		StudentType studentType = registration.getStudentKind().getStudentType();		if (studentType.equals(StudentType.NORMAL)) {		    return "T" + registration.getNumber();		} else if (studentType.equals(StudentType.FOREIGN_STUDENT)) {		    return "I" + registration.getNumber(); // International		    // students		} else if (studentType.equals(StudentType.EXTERNAL_STUDENT)) {		    return "A" + registration.getNumber(); // Academy		    // students		}	    }	    registration = person.getStudentByType(DegreeType.MASTER_DEGREE);	    if (registration != null) {		StudentType studentType = registration.getStudentKind().getStudentType();		if (studentType.equals(StudentType.NORMAL)) {		    return "M" + registration.getNumber();		} else if (studentType.equals(StudentType.FOREIGN_STUDENT)) {		    return "I" + registration.getNumber(); // International		    // students		} else if (studentType.equals(StudentType.EXTERNAL_STUDENT)) {		    return "A" + registration.getNumber(); // Academy		    // students		}	    }	    registration = person.getStudentByType(DegreeType.DEGREE);	    if (registration != null) {		StudentType studentType = registration.getStudentKind().getStudentType();		if (studentType.equals(StudentType.NORMAL)) {		    return "L" + registration.getNumber();		} else if (studentType.equals(StudentType.FOREIGN_STUDENT)) {		    return "I" + registration.getNumber();		} else if (studentType.equals(StudentType.EXTERNAL_STUDENT)) {		    return "A" + registration.getNumber();		}	    }	    registration = person.getStudentByType(DegreeType.BOLONHA_DEGREE);	    if (registration != null) {		StudentType studentType = registration.getStudentKind().getStudentType();		if (studentType.equals(StudentType.NORMAL)) {		    return "L" + registration.getNumber();		} else if (studentType.equals(StudentType.FOREIGN_STUDENT)) {		    return "I" + registration.getNumber();		} else if (studentType.equals(StudentType.EXTERNAL_STUDENT)) {		    return "A" + registration.getNumber();		}	    }	    registration = person.getStudentByType(DegreeType.BOLONHA_INTEGRATED_MASTER_DEGREE);	    if (registration != null) {		StudentType studentType = registration.getStudentKind().getStudentType();		if (studentType.equals(StudentType.NORMAL)) {		    return "L" + registration.getNumber();		} else if (studentType.equals(StudentType.FOREIGN_STUDENT)) {		    return "I" + registration.getNumber();		} else if (studentType.equals(StudentType.EXTERNAL_STUDENT)) {		    return "A" + registration.getNumber();		}	    }	    throw new DomainException("error.person.addingInvalidRole", RoleType.STUDENT.getName());	} else if (roleType.equals(RoleType.GRANT_OWNER)) {	    if (person.getGrantOwner() != null) {		return "B" + person.getGrantOwner().getNumber();	    }		} else if (roleType.equals(RoleType.PROJECTS_MANAGER)		|| roleType.equals(RoleType.INSTITUCIONAL_PROJECTS_MANAGER)) {	    return "G" + person.getIdInternal();		} else if (roleType.equals(RoleType.ALUMNI)) {	    Registration registration = person.getStudentByType(DegreeType.DEGREE);	    if (registration != null) {		return "L" + registration.getNumber();	    }	    throw new DomainException("error.person.addingInvalidRole", RoleType.ALUMNI.getName());	    	} else if (roleType.equals(RoleType.MASTER_DEGREE_CANDIDATE)		|| roleType.equals(RoleType.CANDIDATE)) {	    return "C" + person.getIdInternal();		} else if (roleType.equals(RoleType.PERSON)) {	    return "P" + person.getIdInternal();	}		return null;	    }