private static List<SmartPsiElementPointer<?>> getSortedIDs(Map<SmartPsiElementPointer<?>, ?> requests) {
    List<SmartPsiElementPointer<?>> result = new ArrayList<>();

    ApplicationManager.getApplication().runReadAction(() -> {
      for (SmartPsiElementPointer<?> id : requests.keySet()) {
        if (id != null && id.getContainingFile() != null) {
          result.add(id);
        }
      }
      result.sort((o1, o2) -> {
        PsiFile psiFile1 = o1.getContainingFile();
        LOG.assertTrue(psiFile1 != null);
        PsiFile psiFile2 = o2.getContainingFile();
        LOG.assertTrue(psiFile2 != null);
        return psiFile1.getName().compareTo(psiFile2.getName());
      });
    });

    return result;
  }
private static List<SmartPsiElementPointer<?>> getSortedIDs(Map<SmartPsiElementPointer<?>, ?> requests)