@Test
    public void testClassParsing() throws Exception {
        Metadata metadata = new Metadata();
        String content = getText("AutoDetectParser.class", metadata);
        assertEquals("AutoDetectParser", metadata.get(TikaCoreProperties.TITLE));
        assertEquals("AutoDetectParser.class", metadata.get(TikaCoreProperties.RESOURCE_NAME_KEY));

        assertTrue(content.contains("package org.apache.tika.parser;"));
        assertTrue(content.contains("class AutoDetectParser extends CompositeParser"));
        assertTrue(content.contains("private org.apache.tika.mime.MimeTypes types"));
        assertTrue(content.contains(
                "public void parse(" + "java.io.InputStream, org.xml.sax.ContentHandler," +
                        " org.apache.tika.metadata.Metadata) throws" +
                        " java.io.IOException, org.xml.sax.SAXException," +
                        " org.apache.tika.exception.TikaException;"));
        assertTrue(content.contains("private byte[] getPrefix(java.io.InputStream, int)" +
                " throws java.io.IOException;"));
    }
Test case for parsing Java class files.
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-code-module/src/test/java/org/apache/tika/parser/asm/ClassParserTest.java