if (acronym != null && !acronym.equals("") && this.getType() != null && (this.getType().equals(PartyTypeEnum.DEGREE) || this.getType().equals(PartyTypeEnum.MASTER_DEGREE) || this.getType().equals( PartyTypeEnum.DEPARTMENT))) {  Unit unit = readByAcronymOnMasterDegreeDepartmentAndDegreeUnitTypes(acronym); if (unit != null && !unit.equals(this)) { throw new DomainException("error.existent.acronym"); }
if (acronym != null && !acronym.equals("") && this.getType() != null) { checkAcronym(acronym, this.getType());
    public void edit(String unitName, Integer unitCostCenter, String acronym, Date beginDate,            Date endDate, PartyTypeEnum type, Unit parentUnit, AccountabilityType accountabilityType) {        this.setName(unitName);        this.setBeginDate(beginDate);        this.setEndDate(endDate);        this.setType(type);        this.setCostCenterCode(unitCostCenter);        if (acronym != null                && !acronym.equals("")                && this.getType() != null                && (this.getType().equals(PartyTypeEnum.DEGREE)                        || this.getType().equals(PartyTypeEnum.MASTER_DEGREE) || this.getType().equals(                        PartyTypeEnum.DEPARTMENT))) {                        Unit unit = readByAcronymOnMasterDegreeDepartmentAndDegreeUnitTypes(acronym);            if (unit != null && !unit.equals(this)) {                throw new DomainException("error.existent.acronym");            }        }        this.setAcronym(acronym);        if (parentUnit != null && accountabilityType != null) {            this.addParent(parentUnit, accountabilityType);        }        if (endDate != null && endDate.before(beginDate)) {            throw new DomainException("error.endDateBeforeBeginDate");        }    }