if (!unit.equals(this.getUnit()) && (this.getUnit().getParentUnits().isEmpty() || !this.getUnit().getTopUnits() .contains(unit))) {
if (!unit.equals(this.getUnit())) {
    public String getAllUnitsToChooseParentUnit() throws FenixFilterException, FenixServiceException, ExcepcaoPersistencia {        StringBuilder buffer = new StringBuilder();        List<Unit> allUnitsWithoutParent = UnitUtils.readAllUnitsWithoutParents();        Collections.sort(allUnitsWithoutParent, new BeanComparator("name"));        for (Unit unit : allUnitsWithoutParent) {            if (!unit.equals(this.getUnit())                    && (this.getUnit().getParentUnits().isEmpty() || !this.getUnit().getTopUnits()                            .contains(unit))) {                getUnitTreeToChooseParentUnit(buffer, unit);            }        }        return buffer.toString();    }