@Test
public void testExampleFromHomepage_removeInvalidCharacters() throws Exception {

    // choose the character stream to modify
    Reader reader = new StringReader("foo\uD8FFbar");
    // define what and how to replace
    Modifier modifier = new InvalidXmlCharacterModifier("", InvalidXmlCharacterModifier.XML_11_VERSION);
    // create the modifying reader that wraps the original reader
    ModifyingReader modifyingReader = new ModifyingReader(reader, modifier);
    // use the modifying reader instead of the original reader
    String actualOutput = IOUtils.toString(modifyingReader);
    assertEquals("foobar", actualOutput);
}