@Test
public void testBoilerplateRemoval() throws Exception {

    String path = "/test-documents/boilerplate.html";
    Metadata metadata = new Metadata();
    BodyContentHandler handler = new BodyContentHandler();
    new HtmlParser().parse(
            HtmlParserTest.class.getResourceAsStream(path),
            new BoilerpipeContentHandler(handler), metadata, new ParseContext());
    String content = handler.toString();
    assertTrue(content.startsWith("This is the real meat"));
    assertTrue(content.endsWith("This is the end of the text.\n"));
    assertFalse(content.contains("boilerplate"));
    assertFalse(content.contains("footer"));
}