### Question:
Query { public static void appendQuotedString(StringBuilder query, String string) { query.append('"'); for (char c : string.toCharArray()) { switch (c) { case '"': case '\\': query.append('\\'); query.append(c); break; case '\r': query.append("\\r"); break; case '\n': query.append("\\n"); break; default: if (c < 0x20) { query.append(String.format("\\u%04x", (int) c)); } else { query.append(c); } break; } } query.append('"'); } protected  Query(StringBuilder queryBuilder); static void appendQuotedString(StringBuilder query, String string); T withAlias(String aliasSuffix); static final String ALIAS_SUFFIX_SEPARATOR; }### Answer:
@Test public void testStringEscaping() throws Exception { StringBuilder result = new StringBuilder(); Query.appendQuotedString(result, "\0 \r \n \\ \" c ꝏ"); assertEquals("\"\\u0000 \\r \\n \\\\ \\\" c ꝏ\"", result.toString()); }