if (unit.getType() != null && unit.getType().equals(PartyType.EXTERNAL_INSTITUTION)) {
if (unit.getType() != null && unit.getType().equals(PartyTypeEnum.EXTERNAL_INSTITUTION)) {
    public static List<Unit> readAllExternalInstitutionUnits() throws ExcepcaoPersistencia {                List<Unit> allUnits = RootDomainObject.readAllUnits();         List<Unit> allExternalUnits = new ArrayList<Unit>();        for (Unit unit : allUnits) {            if (unit.getType() != null && unit.getType().equals(PartyType.EXTERNAL_INSTITUTION)) {                allExternalUnits.add(unit);            }        }        return allExternalUnits;    }