StAXUtils { public static XMLEventReader getXMLEventReader(Source source) throws XMLStreamException { XMLEventReader xmlEventReader; if (source instanceof StAXSource) { StAXSource staxSource = (StAXSource) source; if (staxSource.getXMLEventReader() != null) { xmlEventReader = staxSource.getXMLEventReader(); } else { xmlEventReader = new XMLStreamEventReader(staxSource.getXMLStreamReader()); } } else { xmlEventReader = XML_INPUT_FACTORY.createXMLEventReader(source); } return xmlEventReader; } private  StAXUtils(); static XMLStreamReader getXMLStreamReader(Source source); static XMLStreamReader getXMLStreamReader(XMLInputFactory factory, Source source); static XMLEventReader getXMLEventReader(Source source); static XMLStreamWriter getXMLStreamWriter(Result result); static XMLStreamWriter getXMLStreamWriter(XMLOutputFactory factory, Result result); static int skipElement(XMLStreamReader xmlReader);  }
@Test void getXMLEventReader() throws XMLStreamException { assertNotNull(StAXUtils.getXMLEventReader(new StAXSource(mockXMLEventReader()))); assertNotNull(StAXUtils.getXMLEventReader(new StAXSource(mockXMLStreamReader()))); assertNotNull(StAXUtils.getXMLEventReader(new StreamSource(new StringReader("<element/>")))); }