Collection<String> (String reportedPath) { if (myPathMappings.isEmpty()) { return List.of(reportedPath); } var results = new SmartList<>(reportedPath); WatchRootsUtil.forEachPathSegment(reportedPath, File.separatorChar, path -> { myPathMappings.get(path).forEach(mapped -> results.add(mapped + reportedPath.substring(path.length()))); return true; }); return results; }