WebUtils { public static String nl2br(final String string) { if (StringUtils.isEmpty(string)) { return string; } return NL_REGEXP.matcher(string).replaceAll("<br>"); } private  WebUtils(); static String nl2br(final String string); static String replaceLeadingSpaces(final String string); static String extractBaseURLFromRequest(final HttpServletRequest request); static final String APPLICATION_OCTET_STREAM; static final String CONTENT_TYPE_TEXT_PLAIN; static final String CONTENT_DISPOSITION_HEADER; static final String NL; static final String NBSP; static final Pattern NL_REGEXP; }
@Test public void testNl2br() throws Exception { assertEquals("one<br>two", WebUtils.nl2br("one\ntwo")); }