@Test
    public void testSimple() {
        String s1 = "this is a < test";
        String s2 = "this is a & test";
        String s3 = "this is a \" test";
        String s4 = "this is a <\" test";
        String s5 = "this is a low \u001F test";

        assertEquals("this is a &lt; test", XML.xmlEscape(s1, true));
        assertEquals("this is a &amp; test", XML.xmlEscape(s2, true));

        // quotes are only escaped in attributes
        assertEquals("this is a &quot; test", XML.xmlEscape(s3, true));
        assertEquals("this is a \" test", XML.xmlEscape(s3, false));

        // quotes are only escaped in attributes
        assertEquals("this is a &lt;&quot; test", XML.xmlEscape(s4, true));
        assertEquals("this is a &lt;\" test", XML.xmlEscape(s4, false));

        assertEquals("this is a low \uFFFD test", XML.xmlEscape(s5, false));
        String s = XML.xmlEscape(s5, false, false);
        assertEquals(0x1F, s.toCharArray()[14]);
    }
@author Bjorn Borud
@author Steinar Knutsen
vespajlib/src/test/java/com/yahoo/text/XMLTestCase.java