HTMLParser { public static Elements getElements(String html, String tag) { return getElements(parse(html), tag); } private  HTMLParser(); static Document parse(String html); static Elements getElements(String html, String tag); static Elements getElements(Document document, String tag); static List<String> getAttributeValueFromElements(Elements elements, String attributeKey); static List<String> getTextFromElements(Elements elements);  }
@Test public void testHTMLParser_getElements_html_checkTitle() { Elements elements = HTMLParser.getElements(SAMPLE_HTML, "title"); assertEquals(elements.size(), 1); assertEquals(elements.first() .ownText(), "My title"); }