@Test public void escape() throws Exception { assertEquals("", esc.escape(null)); assertEquals("", esc.escape("")); assertEquals("hallo", esc.escape("hallo")); assertEquals("hallo\\\\world", esc.escape("hallo\\world")); assertEquals("hallo\\nworld", esc.escape("hallo\nworld")); assertEquals("hallo\\rworld", esc.escape("hallo\rworld")); assertEquals("hallo\\r\\nworld", esc.escape("hallo\r\nworld")); assertEquals("hallo\\tworld\\t!", esc.escape("hallo\tworld !")); assertEquals("hallo\\bworld", esc.escape("hallo\bworld")); assertEquals("hallo\\fworld", esc.escape("hallo\fworld")); assertEquals("hallo\\fworld", esc.escape("hallo\fworld")); assertEquals("hallo\\'world", esc.escape("hallo'world")); assertEquals("hallo\\\"world", esc.escape("hallo\"world")); assertEquals("hallo\\u2028world", esc.escape("hallo\u2028world")); }
public String escape(String text) { if (isNotBlank(text)) { return replaceEach(text, UNESCAPED, ESCAPED); } return EMPTY; }
Escape { public String escape(String text) { if (isNotBlank(text)) { return replaceEach(text, UNESCAPED, ESCAPED); } return EMPTY; } }
Escape { public String escape(String text) { if (isNotBlank(text)) { return replaceEach(text, UNESCAPED, ESCAPED); } return EMPTY; }  }
Escape { public String escape(String text) { if (isNotBlank(text)) { return replaceEach(text, UNESCAPED, ESCAPED); } return EMPTY; }  String escape(String text); String unescape(String text); }
Escape { public String escape(String text) { if (isNotBlank(text)) { return replaceEach(text, UNESCAPED, ESCAPED); } return EMPTY; }  String escape(String text); String unescape(String text);  }