@Test
    public void defaultParserWithExcludes() throws Exception {
        try {
            TikaConfig config = getConfig("TIKA-1445-default-except.xml");

            CompositeParser cp = (CompositeParser) config.getParser();
            List<Parser> parsers = cp.getAllComponentParsers();
            Parser p;

            // Will be the three parsers defined in the xml
            assertEquals(3, parsers.size());

            // Should have a wrapped DefaultParser, not the main DefaultParser,
            //  as it is excluded from handling certain classes
            p = parsers.get(0);
            assertTrue(p instanceof ParserDecorator, p.toString());
            assertEquals(DefaultParser.class, ((ParserDecorator) p).getWrappedParser().getClass());

            // Should have two others which claim things, which they wouldn't
            //  otherwise handle
            p = parsers.get(1);
            assertTrue(p instanceof ParserDecorator, p.toString());
            assertEquals(EmptyParser.class, ((ParserDecorator) p).getWrappedParser().getClass());
            assertEquals("hello/world", p.getSupportedTypes(null).iterator().next().toString());

            p = parsers.get(2);
            assertTrue(p instanceof ParserDecorator, p.toString());
            assertEquals(ErrorParser.class, ((ParserDecorator) p).getWrappedParser().getClass());
            assertEquals("fail/world", p.getSupportedTypes(null).iterator().next().toString());
        } catch (TikaException e) {
            fail("Unexpected TikaException: " + e);
        }
    }
TIKA-1445 It should be possible to exclude DefaultParser from
certain types, so another parser explicitly listed will take them
tika-core/src/test/java/org/apache/tika/config/TikaConfigTest.java