StringPrintWriter sw = new StringPrintWriter(); try { StringEscapeUtils.escapeHtml(sw, original); } catch (IOException e) { } String actual = original == null ? null : sw.getString(); assertEquals(message, expected, actual);
    public void testEscapeHtml() {        for (int i = 0; i < htmlEscapes.length; ++i) {            String message = htmlEscapes[i][0];            String expected = htmlEscapes[i][1];            String original = htmlEscapes[i][2];            assertEquals(message, expected, StringEscapeUtils.escapeHtml(original));            // todo: add test for (and implement) Writer-based version, something like this://            StringPrintWriter sw = new StringPrintWriter();//            StringEscapeUtils.escapeHtml(sw, original);//            assertEquals(expected, sw.getString());        }    }