### Question:
DumpUtil { public static String encode(String value) { if (value == null) { return ""; } String s = value.replace(QUOTE, ESCAPED_QUOTE); return quote(s); } protected  DumpUtil(); static String encode(String value); static String decode(String value); static String quote(String value);  }### Answer:
@Test public void testEncode() { assertEquals("\"aa\na\"", DumpUtil.encode("aa\na")); assertEquals("\"aa\"\"a\"", DumpUtil.encode("aa\"a")); assertEquals("\"aaa\"", DumpUtil.encode("aaa")); assertEquals("\"\"", DumpUtil.encode("")); assertEquals("", DumpUtil.encode(null)); }