private int findMatchingDigests(String sharedDigestKey, Set<Integer> handledB, Metadata metadata, List<Metadata> metadataListB) {
        String digestA = metadata.get(sharedDigestKey);
        if (digestA == null) {
            return -1;
        }
        String resourceName = metadata.get(TikaCoreProperties.RESOURCE_NAME_KEY);

        int cand = -1;
        for (int i = 0; i < metadataListB.size(); i++) {
            if (handledB.contains(i)) {
                continue;
            }
            Metadata mB = metadataListB.get(i);
            String digestB = mB.get(sharedDigestKey);
            if (digestA.equalsIgnoreCase(digestB)) {
                cand = i;
                if (resourceName != null && resourceName.equals(mB.get(TikaCoreProperties.RESOURCE_NAME_KEY))) {
                    return i;
                }
            }
        }
        return cand;
    }
Try to find the matching metadata based on the AbstractRecursiveParserWrapperHandler.EMBEDDED_RESOURCE_PATH
If you can't find it, return -1;

@param aIndex        index for match in metadataListA
@param metadataListA
@param metadataListB
@return
tika-eval/tika-eval-app/src/main/java/org/apache/tika/eval/app/ExtractComparer.java