if (unit.getType() != null && unit.getType().equals(PartyType.COMPETENCE_COURSE_GROUP)) {
if (unit.getType() != null && unit.getType().equals(PartyTypeEnum.COMPETENCE_COURSE_GROUP)) {
    public List<Unit> getCompetenceCourseGroupUnits() {        List<Unit> result = new ArrayList<Unit>();        for (Unit unit : this.getSubUnits()) {            if (unit.getType() != null && unit.getType().equals(PartyType.COMPETENCE_COURSE_GROUP)) {                result.add(unit);            }        }        return result;    }