public static String quoteStringLiteralForJson(String string)
    {
        return '"' + new String(JsonStringEncoder.getInstance().quoteAsUTF8(string)) + '"';
    }
@Test
    public void testQuoteJson()
    {
        assertEquals("\"foo\"", quoteStringLiteralForJson("foo"));
        assertEquals("\"Presto's\"", quoteStringLiteralForJson("Presto's"));
        assertEquals("\"xx\\\"xx\"", quoteStringLiteralForJson("xx\"xx"));
    }