@Test
public void testExampleFromHomepage_replaceWithErrorMessage() throws Exception {

    // choose the character stream to modify
    Reader reader = new StringReader("foo\uD8FFbar");
    // define what and how to replace
    Modifier modifier = new InvalidXmlCharacterModifier("[INVALID XML CHAR FOUND: $0]",
            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("foo[INVALID XML CHAR FOUND: U+D8FF]bar", actualOutput);
}