EscapeUtils { public static String unescapeLineBreaks(@Nullable String line) { if (line == null) { return null; } if (unescapingRequired(line)) { line = unescape(line); } return line; }  static String escapeLineBreak(@Nullable String line); static String unescapeLineBreaks(@Nullable String line);  }
@Test public void noOpUnEscape() throws Exception{ assertEquals(null, EscapeUtils.unescapeLineBreaks(null)); assertEquals("abc", EscapeUtils.unescapeLineBreaks("abc")); assertEquals("abc\b", EscapeUtils.unescapeLineBreaks("abc\b")); assertEquals("", EscapeUtils.unescapeLineBreaks("")); assertEquals("some text with multi byte 田中 characters.", EscapeUtils.unescapeLineBreaks("some text with multi byte 田中 characters.")); }
@Test(expected = IllegalStateException.class) public void invalidUnEscape() throws Exception{ EscapeUtils.unescapeLineBreaks("abc\\"); }
@Test(expected = IllegalArgumentException.class) public void invalidUnEscape2() throws Exception{ EscapeUtils.unescapeLineBreaks("abc\\k\\n"); }