### Question:
Node implements Cloneable { public String absUrl(String attributeKey) { Validate.notEmpty(attributeKey); String relUrl = attr(attributeKey); if (!hasAttr(attributeKey)) { return ""; } else { URL base; try { try { base = new URL(baseUri); } catch (MalformedURLException e) { URL abs = new URL(relUrl); return abs.toExternalForm(); } if (relUrl.startsWith("?")) relUrl = base.getPath() + relUrl; URL abs = new URL(base, relUrl); return abs.toExternalForm(); } catch (MalformedURLException e) { return ""; } } } protected  Node(String baseUri, Attributes attributes); protected  Node(String baseUri); protected  Node(); abstract String nodeName(); String attr(String attributeKey); Attributes attributes(); Node attr(String attributeKey, String attributeValue); boolean hasAttr(String attributeKey); Node removeAttr(String attributeKey); String baseUri(); void setBaseUri(String baseUri); String absUrl(String attributeKey); Node childNode(int index); List<Node> childNodes(); Node parent(); Document ownerDocument(); void remove(); Node before(String html); Node before(Node node); Node after(String html); Node after(Node node); Node wrap(String html); Node unwrap(); void replaceWith(Node in); List<Node> siblingNodes(); Node nextSibling(); Node previousSibling(); int siblingIndex(); String outerHtml(); String toString(); @Override boolean equals(Object o); @Override int hashCode(); @Override Node clone();  }### Answer:
@Test public void handlesBaseUri() { Tag tag = Tag.valueOf("a"); Attributes attribs = new Attributes(); attribs.put("relHref", "/foo"); attribs.put("absHref", "http: Element noBase = new Element(tag, "", attribs); assertEquals("", noBase.absUrl("relHref")); assertEquals("http: Element withBase = new Element(tag, "http: assertEquals("http: assertEquals("http: assertEquals("", withBase.absUrl("noval")); Element dodgyBase = new Element(tag, "wtf: assertEquals("http: assertEquals("", dodgyBase.absUrl("relHref")); }
@Test public void absHandlesRelativeQuery() { Document doc = Jsoup.parse("<a href='?foo'>One</a> <a href='bar.html?foo'>Two</a>", "http: Element a1 = doc.select("a").first(); assertEquals("http: Element a2 = doc.select("a").get(1); assertEquals("http: }