InvalidXmlCharacterModifier implements Modifier { @Override public AfterModification modify(StringBuilder characterBuffer, int firstModifiableCharacterInBuffer, boolean endOfStreamHit) { matcher.reset(characterBuffer); matcher.region(firstModifiableCharacterInBuffer, characterBuffer.length()); int start = firstModifiableCharacterInBuffer; while (matcher.find(start)) { start = onMatch(characterBuffer); } return factory.skipEntireBuffer(characterBuffer, firstModifiableCharacterInBuffer, endOfStreamHit); } InvalidXmlCharacterModifier(String replacement, String xmlVersion);  InvalidXmlCharacterModifier(int newNumberOfChars, String replacement, String xmlVersion, boolean dollarZero); @Override AfterModification modify(StringBuilder characterBuffer, int firstModifiableCharacterInBuffer,
            boolean endOfStreamHit); @Override String toString(); static final String XML_10_VERSION; static final String XML_11_VERSION; }
@Test public void testModify() throws Exception { assertModify(" ", "a\uD8FFb", "a b", "1.0", 8192, false); assertModify(" ", "a\uD8FFb\uD8FFc", "a b c", "1.0", 8192, false); assertModify("", "a\uD8FFb\uD8FFc", "abc", "1.0", 8192, false); assertModify("", "a\uD8FF\n\uD8FFc", "a\nc", "1.0", 8192, false); }