### Question:
UrlHelper { public static void makeAbsoluteUrls(Document document) { String documentUrl = document.getDocumentURI(); String baseUrl = getBaseUrl(document); for (String attribute : LINK_ATTRIBUTES) { String xpath = " List<Node> nodes = XPathHelper.getXhtmlNodes(document, xpath); for (Node node : nodes) { Node attributeNode = node.getAttributes().getNamedItem(attribute); String value = attributeNode.getNodeValue(); String fullValue = makeFullUrl(documentUrl, baseUrl, value); if (!fullValue.equals(value)) { LOGGER.trace("{} -> {}", value, fullValue); attributeNode.setNodeValue(fullValue); } } } } private  UrlHelper(); static String removeSessionId(String originalUrl); static void makeAbsoluteUrls(Document document); static String getBaseUrl(Document document); static String makeFullUrl(String pageUrl, String baseUrl, String linkUrl); static String makeFullUrl(String contextUrl, String linkUrl); static String getCleanUrl(String url); static String removeAnchors(String url); static String getDomain(String url, boolean includeProtocol, boolean includeSubdomain); static String getDomain(String url, boolean includeProtocol); static String getDomain(String url); static String getCanonicalUrl(String url); static String decodeParameter(String string); static String encodeParameter(String string); static List<String> extractUrls(String text); static boolean isLocalFile(URL url); static String createParameterString(List<Pair<String, String>> parameters); static List<Pair<String, String>> parseParams(String parameterString); static String parseBaseUrl(String url); static boolean isValidUrl(String url); static final Pattern URL_PATTERN; }### Answer:
@Test public void testMakeAbsoluteUrls() throws Exception { Document document = ParseUtil.parseXhtml(ResourceHelper.getResourceFile("/w3c_xhtml_strict.html")); document.setDocumentURI("http: UrlHelper.makeAbsoluteUrls(document); NodeList aNodes = document.getElementsByTagName("a"); Node aNode = aNodes.item(8); assertEquals("http: }