### Question:
PageAnalyzer { public static Set<String> constructAllXPaths(Document document, String keyword) { return constructAllXPaths(document, keyword, false, false); } private  PageAnalyzer(); static String getTitle(Document document); static String[] detectFactTable(Document document); static Set<String> constructAllXPaths(Document document, String keyword); static Set<String> constructAllXPaths(Document document, String keyword, boolean deleteAllIndices,
            boolean wordMatch); static Set<String> keepXPathPointingTo(Set<String> xPaths, String[] targetNodes); static String makeMutualXPath(Set<String> xPathSet); static String constructXPath(Node node); static String constructIdClassXPath(Node node); static String createIdClassString(Node node); static boolean nodeInTable(String xPath, int lookBack); static String getTableCellPath(String xPath); static String getTargetNode(String xpath); static boolean nodeInBox(String xPath, int lookBack); static String findLastBoxSection(String xPath); static String getNextSibling(String xPath); static String getNextSibling(String xPath, boolean tableCellSibling); static String getNextTableCell(String xPath); static String getFirstTableCell(String xPath); static int getNumberOfTableRows(Document document, String attributeXPath); static List<String[]> getTableRows(Document document, String attributeXPath); static List<String[]> getTableRows(Document document, String attributeXPath, String siblingXPath); static String getNextTableRow(String xPath); static String getParentNode(String xPath); static int getNumberOfTableColumns(Document document, String tableTDXPath); static String getTextByXPath(Document document, String xpath); static List<String> getTextsByXPath(Document document, String xPath); static String getSiblingPage(Document document); static String extractTitle(Document webPage); static String extractBodyContent(Document webPage); static List<String> extractDescription(Document webPage); static Map<String, String> extractMetaInformation(Document webPage); static List<String> extractKeywords(Document webPage); static String removeXPathIndices(String xPath); static String removeXPathIndicesFromLastCountNode(String xPath); static String removeXPathIndices(String xPath, String[] removeCountElements); static String removeXPathIndicesNot(String xPath, String[] notRemoveCountElements); static final Logger LOGGER; }### Answer:
@Test public void testXPathConstruction_issue159() throws Exception { DocumentParser htmlParser = ParserFactory.createHtmlParser(); Document document = htmlParser.parse(ResourceHelper.getResourceFile("/webPages/test_issue159.html")); Set<String> xPaths = PageAnalyzer .constructAllXPaths(document, "Who starred in The Invisible Army", false, true); XPathSet xPathSet = new XPathSet(); xPathSet.add(xPaths); String longestXPath = xPathSet.getLongestXPath(); Node node = XPathHelper.getXhtmlNode(document, longestXPath); assertNotNull(node); }