public static Set<String> findCommonRootPath(Collection<String> patternStrs) {
        List<String> rootDirs = patternStrs.stream()
                .map(PathUtils::findRootPath)
                .collect(Collectors.toSet())
                .stream()
                .collect(Collectors.toList());
        Set<String> mergedRootDirs = new HashSet<>();
        for (int i = 0; i < rootDirs.size(); i++) {
            String minCommonWatchDir = rootDirs.get(i);
            for (int j = i; j < rootDirs.size(); j++) {
                if (minCommonWatchDir.startsWith(rootDirs.get(j))) {
                    minCommonWatchDir = rootDirs.get(j);
                }
            }
            mergedRootDirs.add(minCommonWatchDir);
        }
        return mergedRootDirs;
    }
Find the common root path for all patternStrs.
<ul>
  <li>"/tmp/agent/1.txt","/tmp/**\/*.txt","var/run/a.log" -> "/tmp","var/run"
</ul>

@param patternStrs
@return
inlong-agent/agent-common/src/main/java/org/apache/inlong/agent/utils/PathUtils.java