public static XmlPullParserFactory getXmlPullParserFactory() {
        final XmlPullParserFactory xmlPullParserFactory = SmackXmlParser.xmlPullParserFactory;
        if (xmlPullParserFactory != null) {
            return xmlPullParserFactory;
        }

        Iterator<XmlPullParserFactory> iterator = xmlPullParserFactoryServiceLoader.iterator();
        if (!iterator.hasNext()) {
            throw new IllegalStateException(
                    "No XmlPullParserFactory registered with Service Provider Interface (SPI). Is smack-xmlparser-xpp3 or smack-xmlparser-stax in classpath?");
        }
        return iterator.next();
    }
@Test
    public void testSmackXmlParser() {
        assertThrows(IllegalStateException.class, () -> SmackXmlParser.getXmlPullParserFactory());
    }