public static XMLInputFactory getXMLInputFactory() {
        return getProtectedFactory(XMLInputFactory.newInstance());
    }
@Test
    public void testGetXmlInputFactory() {
        XMLInputFactory xmlInputFactory = XmlUtil.getXMLInputFactory();
        assertNotNull(xmlInputFactory);
        // check if the XXE protection is enabled
        assertThrows(XMLStreamException.class,
                () -> staxReadEvents(xmlInputFactory.createXMLEventReader(new StringReader(server.getTestXml()))));
        assertEquals(0, server.getHits());

        assertThrows(IllegalArgumentException.class,
                () -> XmlUtil.setProperty(xmlInputFactory, "test://no-such-property", false));
        ignoreXxeFailureProp.setOrClearProperty("false");
        assertThrows(IllegalArgumentException.class,
                () -> XmlUtil.setProperty(xmlInputFactory, "test://no-such-property", false));
        ignoreXxeFailureProp.setOrClearProperty("true");
        XmlUtil.setProperty(xmlInputFactory, "test://no-such-feature", false);
    }