@Test
public void testEscapeBadSurrogates()
{

    JSONConfig cfg = new JSONConfig().setUseECMA6(false).setBadCharacterPolicy(JSONConfig.ESCAPE);
    Random rand = new Random();
    for ( int i = 0; i <= BAD_CHARS; i++ ){
        char ch = getRandomSurrogate(rand);
        assertThat(JSONUtil.toJSON(surrogateTestMap(ch), cfg), is(makeResult(String.format("\\u%04X", (int)ch))));
    }
}