@Test
public void testBoilerplateDelegation() throws Exception {

    String path = "/test-documents/boilerplate.html";
    Metadata metadata = new Metadata();
    StringWriter sw = new StringWriter();
    new HtmlParser().parse(
            HtmlParserTest.class.getResourceAsStream(path),
            makeHtmlTransformer(sw), metadata, new ParseContext());
    String content = sw.toString();
    // Should have <html>, <head>, <title>, <body> elements
    assertTrue(Pattern.matches("(?s).*<html xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"en\">.*</html>.*$", content));
    assertTrue(Pattern.matches("(?s).*<head>.*</head>.*$", content));
    assertTrue(Pattern.matches("(?s).*<title>Title</title>.*$", content));
    assertTrue(Pattern.matches("(?s).*<body>.*</body>.*$", content));
}