private static @NotNull ModCommand displayProblemCause(@NotNull PsiFile file, @Nullable TrackingRunner.CauseItem root) {
    Project project = file.getProject();
    PsiFile topLevelFile = InjectedLanguageManager.getInstance(project).getTopLevelFile(file);
    Document document = topLevelFile.getFileDocument();
    List<CauseWithDepth> causes;
    if (root == null) {
      causes = Collections.emptyList();
    } else {
      causes = StreamEx.ofTree(new CauseWithDepth(null, root, document), cwd -> cwd.myCauseItem.children()
        .map(child -> new CauseWithDepth(cwd, child, document))).skip(1).toList();
    }
    if (causes.isEmpty()) {
      return ModCommand.error(JavaAnalysisBundle.message("dfa.find.cause.unable"));
    }
    return ModCommand.chooseAction(StringUtil.wordsToBeginFromUpperCase(root.toString()),
                                   ContainerUtil.map(causes, NavigateToCauseAction::new));
  }
private static @NotNull ModCommand displayProblemCause(@NotNull PsiFile file, @Nullable TrackingRunner.CauseItem root)