private static RefEntity @NotNull [] getSelectedElements(InspectionResultsView view) {
    if (view == null) return RefEntity.EMPTY_ELEMENTS_ARRAY;
    RefEntity[] selection = view.getTree().getSelectedElements();
    PsiDocumentManager.getInstance(view.getProject()).commitAllDocuments();
    Arrays.sort(selection, InspectionResultsViewComparator::compareEntities);
    return selection;
  }
private static RefEntity @NotNull [] getSelectedElements(InspectionResultsView view)