@Test
public void replaceSafeUnicodeChars() throws Exception {

    String source = null;
    StringBuilder buffer = null;
    int replaced = -1;
    source = "hello";
    buffer = new StringBuilder(source);
    replaced = MobileTextUtil.replaceSafeUnicodeChars(buffer);
    Assert.assertEquals(0, replaced);
    Assert.assertEquals(source, buffer.toString());
    source = "\u201chello\u201d \u201cworld\u201d \u201cthis\u201d";
    buffer = new StringBuilder(source);
    replaced = MobileTextUtil.replaceSafeUnicodeChars(buffer);
    Assert.assertEquals(6, replaced);
    Assert.assertEquals("\"hello\" \"world\" \"this\"", buffer.toString());
    source = "\u201chello\u201d \u201cworld\u201d \u201cthis\u201d";
    buffer = new StringBuilder(source);
    replaced = MobileTextUtil.replaceSafeUnicodeChars(buffer);
    Assert.assertEquals(6, replaced);
    Assert.assertEquals("\"hello\" \"world\" \"this\"", buffer.toString());
    source = "\u2018hello\u2019 \u2018world\u2019 don\u2019t";
    buffer = new StringBuilder(source);
    replaced = MobileTextUtil.replaceSafeUnicodeChars(buffer);
    Assert.assertEquals(5, replaced);
    Assert.assertEquals("\'hello\' \'world\' don\'t", buffer.toString());
}