@Test
public void testNonBmp() throws ScriptException, NoSuchMethodException
{

    Map<String,Object> jsonObj = new HashMap<>();
    StringBuilder buf = new StringBuilder(2);
    buf.appendCodePoint(0x1F4A9);
    jsonObj.put("x", buf);
    String json = JSONUtil.toJSON(jsonObj);
    validateJSON(json);
    assertThat(json, is("{\"x\":\"\uD83D\uDCA9\"}"));
}