### Question:
WikiPage extends WikiPageReference { public List<String> getAlternativeTitles() { List<String> sections = getSections(); if (sections.size() > 0) { String firstSection = sections.get(0); firstSection = MediaWikiUtil.REF_PATTERN.matcher(firstSection).replaceAll(""); firstSection = MediaWikiUtil.replaceLangPattern(firstSection); firstSection = StringEscapeUtils.unescapeHtml4(firstSection); firstSection = HtmlHelper.stripHtmlTags(firstSection); firstSection = MediaWikiUtil.processLinks(firstSection, MediaWikiUtil.EXTERNAL_LINK_PATTERN); firstSection = MediaWikiUtil.processLinks(firstSection, MediaWikiUtil.INTERNAL_LINK_PATTERN); firstSection = MediaWikiUtil.removeBetween(firstSection, '{', '{', '}', '}'); firstSection = MediaWikiUtil.removeBetween(firstSection, '{', '|', '|', '}'); firstSection = firstSection.trim(); for (String split : firstSection.split("\n")) { List<String> titles = getStringsInBold(split); if (titles.size() > 0) { return titles; } } } return Collections.emptyList(); } 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 testGetAlternativeNames() throws IOException { String markup = FileHelper.readFileToString(ResourceHelper .getResourceFile("/wikipedia/Dry_Fork_(Cheat_River).wikipedia")); WikiPage page = new WikiPage(0, 0, "Dry Fork (Cheat River)", markup); List<String> alternativeTitles = page.getAlternativeTitles(); assertEquals(2, alternativeTitles.size()); assertEquals("Dry Fork", alternativeTitles.get(0)); assertEquals("Dry Run", alternativeTitles.get(1)); markup = FileHelper.readFileToString(ResourceHelper .getResourceFile("/wikipedia/University_of_Pennsylvania.wikipedia")); page = new WikiPage(0, 0, "University of Pennsylvania", markup); alternativeTitles = page.getAlternativeTitles(); assertEquals(3, alternativeTitles.size()); assertEquals("University of Pennsylvania", alternativeTitles.get(0)); assertEquals("Penn", alternativeTitles.get(1)); assertEquals("UPenn", alternativeTitles.get(2)); markup = FileHelper.readFileToString(ResourceHelper.getResourceFile("/wikipedia/MS_Thomson_Majesty.wikipedia")); page = new WikiPage(0, 0, "MS Thomson Majesty", markup); alternativeTitles = page.getAlternativeTitles(); assertEquals(4, alternativeTitles.size()); assertEquals("MS Thomson Majesty", alternativeTitles.get(0)); assertEquals("MS Norwegian Majesty", alternativeTitles.get(1)); assertEquals("MS Birka Queen", alternativeTitles.get(2)); assertEquals("MS Royal Majesty", alternativeTitles.get(3)); }