if (rootWasClicked) {  for (Context context : this.getCourseGroup().getSortedChildContextsWithCourseGroups()) { CourseGroup toBeReported = (CourseGroup) context.getChildDegreeModule(); contextsWithCurricularCourses = contextsWithCurricularCoursesToList(toBeReported);  if (infoToExport.equals(InfoToExport.CURRICULAR_STRUCTURE)) { fillCurricularStructure(toBeReported.getName(), contextsWithCurricularCourses, spreadsheet); spreadsheet.addRow(); } else { fillStudiesPlan(contextsWithCurricularCourses, spreadsheet); spreadsheet.addRow(); } } }
    private void reportInfo(Spreadsheet spreadsheet) throws FenixFilterException, FenixServiceException {        List<Context> contextsWithCurricularCourses = null;        contextsWithCurricularCourses = contextsWithCurricularCoursesToList(this.getCourseGroup());                if (infoToExport.equals(InfoToExport.CURRICULAR_STRUCTURE)) {            fillCurricularStructure(this.getCourseGroup().getName(), contextsWithCurricularCourses, spreadsheet);        } else {            fillStudiesPlan(contextsWithCurricularCourses, spreadsheet);                    }                if (rootWasClicked) {            // first level contexts are to be reported            for (Context context : this.getCourseGroup().getSortedChildContextsWithCourseGroups()) {                CourseGroup toBeReported = (CourseGroup) context.getChildDegreeModule();                contextsWithCurricularCourses = contextsWithCurricularCoursesToList(toBeReported);                                if (infoToExport.equals(InfoToExport.CURRICULAR_STRUCTURE)) {                    fillCurricularStructure(toBeReported.getName(), contextsWithCurricularCourses, spreadsheet);                    spreadsheet.addRow();                } else {                    fillStudiesPlan(contextsWithCurricularCourses, spreadsheet);                    spreadsheet.addRow();                }            }        }     }