DegreeModule parentDegreeModule = parentContext.getDegreeModule(); if (parentDegreeModule instanceof CourseGroup) { if(!((CourseGroup) parentDegreeModule).verifyNames(normalizedName, normalizedNameEn)){ throw new DomainException("error.existingCourseGroupWithSameName"); } }
CourseGroup parentCourseGroup = parentContext.getCourseGroup(); if (!parentCourseGroup.verifyNames(normalizedName, normalizedNameEn, this)) { throw new DomainException("error.existingCourseGroupWithSameName"); }
    public void checkDuplicateBrotherNames(final String name, final String nameEn) throws DomainException  {        String normalizedName = StringFormatter.normalize(name);        String normalizedNameEn = StringFormatter.normalize(nameEn);        for (Context parentContext : getDegreeModuleContexts()) {            DegreeModule parentDegreeModule = parentContext.getDegreeModule();            if (parentDegreeModule instanceof CourseGroup) {                if(!((CourseGroup) parentDegreeModule).verifyNames(normalizedName, normalizedNameEn)){                    throw new DomainException("error.existingCourseGroupWithSameName");                }            }                   }    }