private static Set<VirtualFile> getReadOnlyFiles(RefEntity @NotNull [] refElements) {
    Set<VirtualFile> readOnlyFiles = new HashSet<>();
    for (RefEntity refElement : refElements) {
      PsiElement psiElement = refElement instanceof RefElement ? ((RefElement)refElement).getPsiElement() : null;
      if (psiElement == null || psiElement.getContainingFile() == null) continue;
      readOnlyFiles.add(psiElement.getContainingFile().getVirtualFile());
    }
    return readOnlyFiles;
  }
private static Set<VirtualFile> getReadOnlyFiles(RefEntity @NotNull [] refElements)