HtmlSanitizer implements Sanitizer<String> { @Override public String execute(String content) { return StringEscapeUtils.escapeHtml(content); }  @Override String execute(String content);  }
@Test public void testExecute() throws Exception { HtmlSanitizer sanitizer = new HtmlSanitizer(); assertEquals("&gt;&lt;iframe src='external.html'&gt;&lt;/iframe&gt;", sanitizer.execute("><iframe src='external.html'></iframe>")); assertEquals("&gt;&lt;script&gt;alert('hack!');&lt;/script&gt;", sanitizer.execute("><script>alert('hack!');</script>")); }