@Test
public void testStartEndDocument() throws XMLStreamException {

	XMLStreamReader reader = createXmlStreamReader("<? xml ?>");
	StartDocument startDocument = (StartDocument)eventAllocator.allocate(reader);
	verify(startDocument, XMLStreamConstants.START_DOCUMENT, "<?xml version=\"1.0\"?>");
	Assert.assertEquals("UTF-8", startDocument.getCharacterEncodingScheme());
	Assert.assertFalse(startDocument.encodingSet());
	Assert.assertEquals("1.0", startDocument.getVersion());
	Assert.assertFalse(startDocument.isStandalone());
	Assert.assertFalse(startDocument.standaloneSet());
	reader.next();
	verify((EndDocument)eventAllocator.allocate(reader), XMLStreamConstants.END_DOCUMENT, "");
	reader = createXmlStreamReader("<? xml version=\"1.1\" ?>");
	startDocument = (StartDocument)eventAllocator.allocate(reader);
	Assert.assertEquals("1.1", startDocument.getVersion());
	
	reader = createXmlStreamReader("<? xml encoding=\"UTF-16\"?>");
	startDocument = (StartDocument)eventAllocator.allocate(reader);
	Assert.assertEquals("UTF-16", startDocument.getCharacterEncodingScheme());
	Assert.assertTrue(startDocument.encodingSet());
}