List<Path> (@NotNull Collection<? extends Path> affectedFiles) { List<Path> result = new ArrayList<>(); for (Path file : affectedFiles) { try { file.getFileSystem().provider().checkAccess(file, AccessMode.WRITE); } catch (NoSuchFileException ignored) { } catch (IOException ignored) { result.add(file); } } return result; }