### Question:
WebPageDateEvaluator { public static ExtractedDate getBestPubDateHtml5(Document document) { Validate.notNull(document, "document must not be null"); List<Node> articleNodes = XPathHelper.getXhtmlNodes(document, " Node nodeToCheck = null; int longest = -1; for (Node articleNode : articleNodes) { int articleLength = HtmlHelper.getInnerXml(articleNode).length(); if (articleLength > longest) { nodeToCheck = articleNode; longest = articleLength; } } if (nodeToCheck == null) { nodeToCheck = document; } if (nodeToCheck != null) { List<Node> timeNodes = XPathHelper.getXhtmlNodes(nodeToCheck, ". for (Node timeNode : timeNodes) { NamedNodeMap attributes = timeNode.getAttributes(); if (attributes.getNamedItem("pubdate") != null) { Node dateTime = attributes.getNamedItem("datetime"); if (dateTime != null) { return DateParser.findDate(dateTime.getTextContent()); } } } } return null; } private  WebPageDateEvaluator(); static List<RatedDate<ExtractedDate>> getDates(Document document, PageDateType type); static RatedDate<ExtractedDate> getBestDate(Document document, PageDateType type); static ExtractedDate getBestPubDateHtml5(Document document); static RatedDate<ExtractedDate> getBestDate(String url, PageDateType type); @SuppressWarnings("unchecked") static List<RatedDate<ExtractedDate>> rate(List<? extends ExtractedDate> extractedDates, PageDateType type);  }### Answer:
@Test public void testGetDateHtml5() throws FileNotFoundException, ParserException { Document document = htmlParser.parse(ResourceHelper.getResourceFile("/webPages/dateExtraction/nbcnews.html")); ExtractedDate date = WebPageDateEvaluator.getBestPubDateHtml5(document); assertEquals("2012-09-07 08:33:12", date.getNormalizedDateString()); document = htmlParser.parse(ResourceHelper.getResourceFile("/webPages/website105.html")); date = WebPageDateEvaluator.getBestPubDateHtml5(document); assertEquals("2012-12-09 15:45", date.getNormalizedDateString()); }