### Question:
WikiPage extends WikiPageReference { public List<String> getSections() { List<String> result = new ArrayList<>(); Matcher matcher = MediaWikiUtil.HEADING_PATTERN.matcher(text); int start = 0; while (matcher.find()) { int end = matcher.start(); result.add(text.substring(start, end)); start = end; } result.add(text.substring(start)); return result; } WikiPage(int pageId, int namespaceId, String title, String text); String getMarkup(); String getCleanText(); List<String> getSections(); boolean isRedirect(); String getRedirectTitle(); List<String> getAlternativeTitles(); @Deprecated String getInfoboxMarkup(); @Deprecated String getInfoboxType(); List<WikiTemplate> getInfoboxes(); List<WikiTemplate> getTemplates(String... templateNames); List<String> getCategories(); boolean isDisambiguation(); List<WikiLink> getLinks(); @Override MarkupCoordinate getCoordinate(); @Override Set<String> getTags(); @Override String toString();  }### Answer:
@Test public void testGetSections() throws IOException { String markup = FileHelper.readFileToString(ResourceHelper.getResourceFile("/wikipedia/Dresden.wikipedia")); WikiPage page = new WikiPage(0, 0, "Dresden", markup); List<String> sections = page.getSections(); assertEquals(46, sections.size()); }