public static SAXParserFactory getSAXParserFactory() throws ParserConfigurationException, SAXException {
        SAXParserFactory factory = SAXParserFactory.newInstance();
        setFeature(factory, FEATURES_DISALLOW_DOCTYPE);
        return factory;
    }
@SuppressWarnings("deprecation")
    @Test
    public void testGetSAXParserFactory() throws Exception {
        SAXParserFactory saxParserFactory = XmlUtil.getSAXParserFactory();
        assertNotNull(saxParserFactory);
        // check if the XXE protection is enabled
        SAXParser saxParser = saxParserFactory.newSAXParser();
        assertThrows(SAXException.class,
                () -> saxParser.parse(new ByteArrayInputStream(server.getTestXml().getBytes(UTF_8)), new HandlerBase()));
        assertEquals(0, server.getHits());

        assertThrows(SAXException.class, () -> XmlUtil.setFeature(saxParserFactory, "test://no-such-feature"));
        ignoreXxeFailureProp.setOrClearProperty("false");
        assertThrows(SAXException.class, () -> XmlUtil.setFeature(saxParserFactory, "test://no-such-feature"));
        ignoreXxeFailureProp.setOrClearProperty("true");
        XmlUtil.setFeature(saxParserFactory, "test://no-such-feature");
    }