@Test public void after() {

    Document doc = Jsoup.parse("<p>This <a>is</a> <a>jsoup</a>.</p>");
    doc.select("a").after("<span>foo</span>");
    assertEquals("<p>This <a>is</a><span>foo</span> <a>jsoup</a><span>foo</span>.</p>", TextUtil.stripNewlines(doc.body().html()));
}