@Test
public void testSpecializations() throws Exception {

    //Test that our manually constructed list of children of zip and tar
    //in PackageParser is current with TikaConfig's defaultConfig.
    TikaConfig config = TikaConfig.getDefaultConfig();
    MediaTypeRegistry mediaTypeRegistry = config.getMimeRepository().getMediaTypeRegistry();
    Set<MediaType> currentSpecializations = new HashSet<>();
    MediaType tar = MediaType.parse("application/x-tar");
    for (MediaType type : mediaTypeRegistry.getTypes()) {
        if (mediaTypeRegistry.isSpecializationOf(type, MediaType.APPLICATION_ZIP)
                || mediaTypeRegistry.isSpecializationOf(type, tar)) {
            currentSpecializations.add(type);
              System.out.println("\""+type.toString()+"\",");
        }
    }
    for (MediaType mediaType : currentSpecializations) {
        assertTrue("missing: "+mediaType, PackageParser.PACKAGE_SPECIALIZATIONS.contains(mediaType));
    }
    assertEquals(currentSpecializations.size(), PackageParser.PACKAGE_SPECIALIZATIONS.size());
}