public SectionBag getSectionBag(Section currentSection) { SectionBag section = this.getSection(currentSection.id()); if (section != null) { return section; } else { section = new SectionBag(); section.setChapter(this); section.setId(currentSection.id()); section.setActions(new ArrayList<ActionBag>()); sections.add(section); return section; } }