PrettyStaxDriver extends StandardStaxDriver { @Override protected XMLInputFactory createInputFactory() { return jdkOnlyStax ? super.createInputFactory() : fallbackInputFactory(); } PrettyStaxDriver();  PrettyStaxDriver(Collection<String> pCdataFields, boolean jdkOnlyStax); @Override HierarchicalStreamWriter createWriter(OutputStream out); @Override HierarchicalStreamWriter createWriter(Writer out);  }
@Test public void testXmlInputFactory() { assertNotNull(new PrettyStaxDriver(cdata, true).createInputFactory()); assertNotNull(new PrettyStaxDriver(cdata, false).createInputFactory()); }