PropertyReplacementFilter extends StreamReaderDelegate { @Override public String getElementText() throws XMLStreamException { return this.replace(super.getElementText()); } PropertyReplacementFilter(XMLStreamReader reader);  PropertyReplacementFilter(XMLStreamReader reader, Properties properties); @Override String getAttributeValue(int index); @Override String getAttributeValue(String namespaceUri, String localName); @Override String getElementText(); @Override String getText(); @Override char[] getTextCharacters(); @Override int getTextCharacters(int sourceStart, char[] target, int targetStart, int length);  }
@Test public void getElementText() throws XMLStreamException { String expected = "expected"; when(this.reader.getElementText()).thenReturn(expected); String result = this.filter.getElementText(); assertSame(expected, result); when(this.reader.getElementText()).thenReturn(String.format("Expect the un%s!", SYSTEM_PROPERTY)); result = this.filter.getElementText(); assertEquals("Expect the unexpected!", result); }