@Test
    public void testArchiveDetection() throws Exception {
        assertTypeByName("application/x-archive", "test.ar");
        assertTypeByName("application/zip", "test.zip");
        assertTypeByName("application/x-tar", "test.tar");
        assertTypeByName("application/gzip", "test.tgz"); // See GZIP, not tar contents of it
        assertTypeByName("application/x-cpio", "test.cpio");
        assertTypeByName("application/vnd.ms-cab-compressed", "test.cab");

        assertTypeByNameAndData("application/x-bzip2", "test-bz2.txt.bz2");
        assertTypeByName("application/x-bzip2", "test-bz2.txt.bz2");
        assertTypeByData("application/x-bzip2", "test-bz2.txt.bz2");
        // TODO Add an example .deb and .udeb, then check these

        // Check the mime magic patterns for them work too
        assertTypeByData("application/x-archive", "testARofText.ar");
        assertTypeByData("application/x-archive", "testARofSND.ar");
        assertTypeByData("application/zip", "test-documents.zip");
        assertTypeByData("application/x-gtar", "test-documents.tar"); // GNU TAR
        assertTypeByData("application/gzip",
                "test-documents.tgz"); // See GZIP, not tar contents of it
        assertTypeByData("application/x-cpio", "test-documents.cpio");
        assertTypeByData("application/vnd.ms-cab-compressed", "test-documents.cab");

        // For spanned zip files, the .zip file doesn't have the header, it's the other parts
        assertTypeByData("application/octet-stream", "test-documents-spanned.zip");
        assertTypeByData("application/zip", "test-documents-spanned.z01");

        assertTypeDetection("testZSTD.zst", "application/zstd");
    }
Note - detecting container formats by mime magic is very very
iffy, as we can't be sure where things will end up.
People really ought to use the container aware detection...
tika-parsers/tika-parsers-standard/tika-parsers-standard-package/src/test/java/org/apache/tika/mime/TestMimeTypes.java