@Test
public void testXmlRestrictedCharReader() throws Exception {

    String s = "\u0001abcdefghijklmnop\u0002";
    StringReader r = new StringReader(s);
    XmlRestrictedCharReader x = new XmlRestrictedCharReader(r);
    char[] chars = new char[s.length() + 1];
    int n = x.read(chars); // the first and last characters should never show up
    assertEquals(s.length() - 2, n);
    assertEquals("abcdefghijklmnop", new String(chars, 0, n));
}