class StripHtmlSanitizer implements Sanitizer<String> {

    @Override
    public String execute(String content) {
        if (StringUtils.isBlank(content)) {
            return content;
        }
        Document document = Jsoup.parse(content);
        document.outputSettings().escapeMode(Entities.EscapeMode.xhtml);
        for (Element element : document.select("script,link,iframe,style")) {
            element.remove();
        }
        return document.text();
    }

}

class StripHtmlSanitizerTest {

    private static final String URL;

    @Test
    public void testExecute() throws Exception {


        StripHtmlSanitizer sanitizer = new StripHtmlSanitizer();

        String html = IOUtils.toString(getClass().getResourceAsStream("StripHtmlSanitizerTest_dirty.html"));

        assertEquals("SPG Flights FAQs Home Frequently Asked Questions", sanitizer.execute(html));
    }

}