@Test
    public void testExtractStandards() throws Exception {

        Metadata metadata = new Metadata();

        StandardsExtractingContentHandler handler =
                new StandardsExtractingContentHandler(new BodyContentHandler(-1), metadata);
        handler.setThreshold(0.25);
        InputStream inputStream = getResourceAsStream("/test-documents/testStandardsExtractor.txt");

        AUTO_DETECT_PARSER.parse(inputStream, handler, metadata, new ParseContext());
        String[] standardReferences =
                metadata.getValues(StandardsExtractingContentHandler.STANDARD_REFERENCES);

        assertTrue(standardReferences[0].equals("ANSI/TIA 222-G"));
        assertTrue(standardReferences[1].equals("TIA/ANSI 222-G-1"));
        assertTrue(standardReferences[2].equals("FIPS 140-2"));
        assertTrue(standardReferences[3].equals("FIPS 197"));
    }
Test class for the {@link StandardsExtractingContentHandler} class.
tika-parsers/tika-parsers-standard/tika-parsers-standard-package/src/test/java/org/apache/tika/sax/StandardsExtractingContentHandlerTest.java