### Question:
Element extends Node { public String text() { StringBuilder sb = new StringBuilder(); text(sb); return sb.toString().trim(); } Element(Tag tag, String baseUri, Attributes attributes);  Element(Tag tag, String baseUri); @Override String nodeName(); String tagName(); Element tagName(String tagName); Tag tag(); boolean isBlock(); String id(); Element attr(String attributeKey, String attributeValue); Map<String, String> dataset(); @Override final Element parent(); Elements parents(); Element child(int index); Elements children(); Elements select(String query); Element appendChild(Node child); Element prependChild(Node child); Element appendElement(String tagName); Element prependElement(String tagName); Element appendText(String text); Element prependText(String text); Element append(String html); Element prepend(String html); @Override Element before(String html); @Override Element before(Node node); @Override Element after(String html); @Override Element after(Node node); Element empty(); @Override Element wrap(String html); Elements siblingElements(); Element nextElementSibling(); Element previousElementSibling(); Element firstElementSibling(); Integer elementSiblingIndex(); Element lastElementSibling(); Elements getElementsByTag(String tagName); Element getElementById(String id); Elements getElementsByClass(String className); Elements getElementsByAttribute(String key); Elements getElementsByAttributeStarting(String keyPrefix); Elements getElementsByAttributeValue(String key, String value); Elements getElementsByAttributeValueNot(String key, String value); Elements getElementsByAttributeValueStarting(String key, String valuePrefix); Elements getElementsByAttributeValueEnding(String key, String valueSuffix); Elements getElementsByAttributeValueContaining(String key, String match); Elements getElementsByAttributeValueMatching(String key, Pattern pattern); Elements getElementsByAttributeValueMatching(String key, String regex); Elements getElementsByIndexLessThan(int index); Elements getElementsByIndexGreaterThan(int index); Elements getElementsByIndexEquals(int index); Elements getElementsContainingText(String searchText); Elements getElementsContainingOwnText(String searchText); Elements getElementsMatchingText(Pattern pattern); Elements getElementsMatchingText(String regex); Elements getElementsMatchingOwnText(Pattern pattern); Elements getElementsMatchingOwnText(String regex); Elements getAllElements(); String text(); String ownText(); Element text(String text); boolean hasText(); String data(); String className(); Set<String> classNames(); Element classNames(Set<String> classNames); boolean hasClass(String className); Element addClass(String className); Element removeClass(String className); Element toggleClass(String className); String val(); Element val(String value); String html(); Element html(String html); String toString(); @Override boolean equals(Object o); @Override int hashCode(); @Override Element clone();  }### Answer:
@Test public void testNormalisesText() { String h = "<p>Hello<p>There.</p> \n <p>Here <b>is</b> \n s<b>om</b>e text."; Document doc = Jsoup.parse(h); String text = doc.text(); assertEquals("Hello There. Here is some text.", text); }
@Test public void testKeepsPreText() { String h = "<p>Hello \n \n there.</p> <div><pre> What's \n\n that?</pre>"; Document doc = Jsoup.parse(h); assertEquals("Hello there. What's \n\n that?", doc.text()); }