@Test
    public void defaultParserExclude() throws Exception {
        TikaConfig config = new TikaConfig();
        assertNotNull(config.getParser());
        assertNotNull(config.getDetector());
        CompositeParser cp = (CompositeParser) config.getParser();
        List<Parser> parsers = cp.getAllComponentParsers();

        boolean hasXML = false;
        for (Parser p : parsers) {
            if (p instanceof XMLParser) {
                hasXML = true;
                break;
            }
        }
        assertTrue(hasXML, "Default config should include an XMLParser.");

        // This custom TikaConfig should exclude XMLParser and all of its subclasses.
        config = getConfig("TIKA-1558-excludesub.xml");
        cp = (CompositeParser) config.getParser();
        parsers = cp.getAllComponentParsers();

        for (Parser p : parsers) {
            if (p instanceof XMLParser) {
                fail("Custom config should not include an XMLParser (" + p.getClass() + ").");
            }
        }
    }
TIKA-1558 It should be possible to exclude Parsers from being picked up by
DefaultParser.
tika-parsers/tika-parsers-standard/tika-parsers-standard-package/src/test/java/org/apache/tika/config/TikaParserConfigTest.java