if (unit.getType() != null && unit.getType().equals(PartyType.EXTERNAL_INSTITUTION)
if (unit.getType() != null && unit.getType().equals(PartyTypeEnum.EXTERNAL_INSTITUTION)
    public static Unit readExternalInstitutionUnitByName(String name) throws ExcepcaoPersistencia{        List<Unit> allUnits = RootDomainObject.readAllUnits();                Unit externalUnit = null;                for (Unit unit : allUnits) {            if (unit.getType() != null && unit.getType().equals(PartyType.EXTERNAL_INSTITUTION)                    && unit.getName().equals(name)) {                externalUnit = unit;            }        }                return externalUnit;    }