Set<String> (@Nullable Collection<File> files) { if (files == null) return null; if (files.isEmpty()) return Collections.emptySet(); LinkedHashSet<String> paths = new LinkedHashSet<>(files.size()); for (File file : files) { if (file != null) { paths.add(file.getPath()); } } return Collections.unmodifiableSet(paths); }