Collection<Html5SectionTreeElement> () { final Collection<Html5SectionTreeElement> result = new ArrayList<>(); for (SectionHolder sectionHolder : myRootSectionHolders) { for (Section section : sectionHolder.getChildren()) { if ("td".equalsIgnoreCase(section.getTag().getName()) && section.getHeader() == null && section.getChildren().isEmpty()) { continue; } result.add(createHtml5SectionTreeElement(section)); } } return result; }