@Test
    public void testMimeExcludeInclude() throws Exception {
        TikaConfig config = getConfig("TIKA-1558-exclude.xml");
        assertNotNull(config.getParser());
        assertNotNull(config.getDetector());
        Parser parser = config.getParser();

        MediaType PDF = MediaType.application("pdf");
        MediaType JPEG = MediaType.image("jpeg");


        // Has two parsers
        assertEquals(CompositeParser.class, parser.getClass());
        CompositeParser cParser = (CompositeParser) parser;
        assertEquals(2, cParser.getAllComponentParsers().size());

        // Both are decorated
        assertTrue(cParser.getAllComponentParsers().get(0) instanceof ParserDecorator);
        assertTrue(cParser.getAllComponentParsers().get(1) instanceof ParserDecorator);
        ParserDecorator p0 = (ParserDecorator) cParser.getAllComponentParsers().get(0);
        ParserDecorator p1 = (ParserDecorator) cParser.getAllComponentParsers().get(1);


        // DefaultParser will be wrapped with excludes
        assertEquals(DefaultParser.class, p0.getWrappedParser().getClass());

        assertNotContained(PDF, p0.getSupportedTypes(context));
        assertContains(PDF, p0.getWrappedParser().getSupportedTypes(context));
        assertNotContained(JPEG, p0.getSupportedTypes(context));
        assertContains(JPEG, p0.getWrappedParser().getSupportedTypes(context));


        // Will have an empty parser for PDF
        assertEquals(EmptyParser.class, p1.getWrappedParser().getClass());
        assertEquals(1, p1.getSupportedTypes(context).size());
        assertContains(PDF, p1.getSupportedTypes(context));
        assertNotContained(PDF, p1.getWrappedParser().getSupportedTypes(context));
    }
Junit test class for {@link TikaConfig}, which cover things
that {@link TikaConfigTest} can't do due to a need for the
full set of parsers
tika-parsers/tika-parsers-standard/tika-parsers-standard-package/src/test/java/org/apache/tika/config/TikaParserConfigTest.java