private static boolean checkProblemFilesInMap(@NotNull Condition<? super VirtualFile> condition, @NotNull Map<? extends VirtualFile, ?> map) {
    if (!map.isEmpty()) {
      for (VirtualFile problemFile : map.keySet()) {
        if (problemFile.isValid() && condition.value(problemFile)) return true;
      }
    }
    return false;
  }
private static boolean checkProblemFilesInMap(@NotNull Condition<? super VirtualFile> condition, @NotNull Map<? extends VirtualFile, ?> map)