### Question:
StaxUtils { public static boolean isStaxResult(Result result) { return (result instanceof StaxResult || (jaxp14Available && Jaxp14StaxHandler.isStaxResult(result))); }  static Source createCustomStaxSource(XMLStreamReader streamReader); static Source createStaxSource(XMLStreamReader streamReader); static Source createCustomStaxSource(XMLEventReader eventReader); static Source createStaxSource(XMLEventReader eventReader); static boolean isStaxSource(Source source); static boolean isStaxSourceClass(Class<? extends Source> clazz); static Result createCustomStaxResult(XMLStreamWriter streamWriter); static Result createStaxResult(XMLStreamWriter streamWriter); static Result createCustomStaxResult(XMLEventWriter eventWriter); static Result createStaxResult(XMLEventWriter eventWriter); static boolean isStaxResult(Result result); static XMLStreamReader getXMLStreamReader(Source source); static XMLEventReader getXMLEventReader(Source source); static XMLStreamWriter getXMLStreamWriter(Result result); static XMLEventWriter getXMLEventWriter(Result result); static ContentHandler createContentHandler(XMLStreamWriter streamWriter); static ContentHandler createContentHandler(XMLEventWriter eventWriter); static XMLReader createXMLReader(XMLStreamReader streamReader); static XMLReader createXMLReader(XMLEventReader eventReader); static XMLStreamReader createEventStreamReader(XMLEventReader eventReader); static XMLStreamWriter createEventStreamWriter(XMLEventWriter eventWriter); static XMLStreamWriter createEventStreamWriter(XMLEventWriter eventWriter, XMLEventFactory eventFactory);  }### Answer:
@Test public void isStaxResultInvalid() throws Exception { assertFalse("A StAX Result", StaxUtils.isStaxResult(new DOMResult())); assertFalse("A StAX Result", StaxUtils.isStaxResult(new SAXResult())); assertFalse("A StAX Result", StaxUtils.isStaxResult(new StreamResult())); }
@Test public void isStaxResult() throws Exception { XMLOutputFactory outputFactory = XMLOutputFactory.newInstance(); XMLStreamWriter streamWriter = outputFactory.createXMLStreamWriter(new StringWriter()); Result result = StaxUtils.createCustomStaxResult(streamWriter); assertTrue("Not a StAX Result", StaxUtils.isStaxResult(result)); }
@Test public void isStaxResultJaxp14() throws Exception { XMLOutputFactory outputFactory = XMLOutputFactory.newInstance(); XMLStreamWriter streamWriter = outputFactory.createXMLStreamWriter(new StringWriter()); StAXResult result = new StAXResult(streamWriter); assertTrue("Not a StAX Result", StaxUtils.isStaxResult(result)); }