@Nullable
  public static UsageView showInUsageView(@Nullable PsiElement sourceElement,
                                          PsiElement @NotNull [] targets,
                                          @NotNull @NlsContexts.TabTitle String title,
                                          @NotNull Project project) {
    if (targets.length == 0) return null;

    SmartPointerManager smartPointerManager = SmartPointerManager.getInstance(project);
    SmartPsiElementPointer<?>[] pointers = Stream.of(targets).map(smartPointerManager::createSmartPsiElementPointer).toArray(SmartPsiElementPointer[]::new);
    // usage view will load document/AST so still referencing all these PSI elements might lead to out of memory
    //noinspection UnusedAssignment
    targets = PsiElement.EMPTY_ARRAY;
    return showInUsageView(sourceElement, title, project, pointers);
  }
@Nullable
  public static UsageView showInUsageView(@Nullable PsiElement sourceElement,
                                          PsiElement @NotNull [] targets,
                                          @NotNull @NlsContexts.TabTitle String title,
                                          @NotNull Project project)