@Test
public void testReplaceUndefined()
{

    JSONConfig cfg = new JSONConfig().setUseECMA6(false).setBadCharacterPolicy(JSONConfig.REPLACE);
    Random rand = new Random();
    final String result = makeResult(StringProcessor.UNICODE_REPLACEMENT_CHARACTER);
    for ( int i = 0; i <= BAD_CHARS; i++ ){
        assertThat(JSONUtil.toJSON(undefinedTestMap(getRandomUndefined(rand)), cfg), is(result));
    }
}