@Test
public void testWriteEntityRef() throws XMLStreamException {

	XMLStreamWriter writer = createXMLStreamWriter(false);
	writer.writeStartElement("foo");
	writer.writeEntityRef("bar");
	writer.writeEndElement();
	writer.flush();
	Assert.assertEquals("<foo>&bar;</foo>", writer.toString());
}