private static void filterOutInvalid(final Collection<VirtualFile> files) {
   for (Iterator<VirtualFile> iterator = files.iterator(); iterator.hasNext(); ) {
     final VirtualFile file = iterator.next();
     if (!file.isValid() || !file.exists()) {
       LOG.info("Refresh root is not valid: " + file.getPath());
       iterator.remove();
     }
   }
 }
 private void checkOverwrites(final Project project) {
   final Collection<AddedFileInfo> addedFileInfos = myAddedFiles.get(project);
   final Collection<File> deletedFiles = myDeletedFiles.get(project);
   if (addedFileInfos.isEmpty() || deletedFiles.isEmpty()) return;
   final Iterator<AddedFileInfo> iterator = addedFileInfos.iterator();
   while (iterator.hasNext()) {
     AddedFileInfo addedFileInfo = iterator.next();
     final File ioFile = new File(addedFileInfo.myDir.getPath(), addedFileInfo.myName);
     if (deletedFiles.remove(ioFile)) {
       iterator.remove();
     }
   }
 }