@Test
public void testNewlineAndIndent() throws Exception {

    final String html = "<html><head><title>Title</title></head>" +
            "<body><ul><li>one</li></ul></body></html>";
    BodyContentHandler handler = new BodyContentHandler();
    new HtmlParser().parse(
            new ByteArrayInputStream(html.getBytes(UTF_8)),
            handler, new Metadata(), new ParseContext());
    // Make sure we get <tab>, "one", newline, newline
    String result = handler.toString();
    assertTrue(Pattern.matches("\tone\n\n", result));
}