private static List<Detector> getDefaultDetectors(MimeTypes types, ServiceLoader loader,
                                                      Collection<Class<? extends Detector>>
                                                              excludeDetectors) {
        List<Detector> detectors =
                loader.loadStaticServiceProviders(Detector.class, excludeDetectors);

        ServiceLoaderUtils.sortLoadedClasses(detectors);
        //look for the override index and put that first
        int overrideIndex = -1;
        int i = 0;
        for (Detector detector : detectors) {
            if (detector instanceof OverrideDetector) {
                overrideIndex = i;
                break;
            }
            i++;
        }
        if (overrideIndex > -1) {
            Detector detector = detectors.remove(overrideIndex);
            detectors.add(0, detector);
        }
        // Finally the Tika MimeTypes as a fallback
        detectors.add(types);
        return detectors;
    }
Finds all statically loadable detectors and sort the list by name,
rather than discovery order. Detectors are used in the given order,
so put the Tika parsers last so that non-Tika (user supplied)
parsers can take precedence.
<p>
If an {@link OverrideDetector} is loaded, it takes precedence over
all other detectors.

@param loader service loader
@return ordered list of statically loadable detectors
tika-core/src/main/java/org/apache/tika/detect/DefaultDetector.java