if ((student.getPerson().getUsername().indexOf("Mes") != -1) || (student.getPerson().getUsername().indexOf("Esp") != -1) || (student.getPerson().getUsername().indexOf("Int") != -1)) {
String currentUsername = student.getPerson().getUsername(); if (!currentUsername.matches("[a-zA-Z][0-9]+")) {
    private void changeUsernameIfNeccessary(IStudent student) throws ExcepcaoPersistencia {        if ((student.getPerson().getUsername().indexOf("Mes") != -1)                || (student.getPerson().getUsername().indexOf("Esp") != -1)                || (student.getPerson().getUsername().indexOf("Int") != -1)) {            student.getPerson().setUsername("M" + student.getNumber());        }    }