if (rootWasClicked && courseGroupBeingReported != null) {
if (rootWasClicked && !this.getCourseGroup().getSortedChildContextsWithCourseGroups().isEmpty()) {
    private void fillCurricularStructure(String courseGroupBeingReported, List<Context> contextsWithCurricularCourses, final Spreadsheet spreadsheet) throws FenixFilterException, FenixServiceException {        Set<Unit> scientificAreaUnits = new HashSet<Unit>();                for (final Context contextWithCurricularCourse : contextsWithCurricularCourses) {            CurricularCourse curricularCourse = (CurricularCourse) contextWithCurricularCourse.getChildDegreeModule();                        if (!curricularCourse.isOptional()                    && !scientificAreaUnits.contains(curricularCourse.getCompetenceCourse().getScientificAreaUnit())) {                final Row row = spreadsheet.addRow();                                if (rootWasClicked && courseGroupBeingReported != null) {                    row.setCell(courseGroupBeingReported);                }                row.setCell(curricularCourse.getCompetenceCourse().getScientificAreaUnit().getName());                row.setCell(curricularCourse.getCompetenceCourse().getScientificAreaUnit().getAcronym());                row.setCell(curricularCourse.getCompetenceCourse().getScientificAreaUnit().getScientificAreaUnitEctsCredits(contextsWithCurricularCourses).toString());                                scientificAreaUnits.add(curricularCourse.getCompetenceCourse().getScientificAreaUnit());            }        }    }