private static void invalidateAnnotations(@NotNull Collection<? extends FileAnnotation> annotations, boolean reload) {
    if (annotations.isEmpty()) return;
    getApplication().invokeLater(() -> {
      for (FileAnnotation annotation : annotations) {
        try {
          if (reload) {
            annotation.reload(null);
          }
          else {
            annotation.close();
          }
        }
        catch (Exception e) {
          LOG.error(e);
        }
      }
    });
  }
private static void invalidateAnnotations(@NotNull Collection<? extends FileAnnotation> annotations, boolean reload)