@Test public void testClonesDeclarations() {

    Document doc = Jsoup.parse("<!DOCTYPE html><html><head><title>Doctype test");
    Document clone = doc.clone();
    assertEquals(doc.html(), clone.html());
    assertEquals("<!DOCTYPE html><html><head><title>Doctype test</title></head><body></body></html>",
            TextUtil.stripNewlines(clone.html()));
}