private PsiExpression @Nullable [] getDuplicateLiteralsUnderProgress(@NotNull PsiElement literalExpression) {
    if (!(literalExpression instanceof PsiLiteralExpression)) return null;
    Project project = literalExpression.getProject();
    ThrowableComputable<PsiExpression[], RuntimeException> findDuplicatesComputable = () -> {
      return ReadAction.compute(() -> getDuplicateLiterals(project,
                                                           (PsiLiteralExpression)literalExpression,
                                                           false /* here we want find all the expressions */));
    };
    if (IntentionPreviewUtils.isPreviewElement(literalExpression)) {
      PsiExpression[] expressions = findDuplicatesComputable.compute();
      if (expressions == null) return null;
      PsiFile file = literalExpression.getContainingFile();
      return ContainerUtil.map2Array(expressions, PsiExpression.EMPTY_ARRAY, e -> PsiTreeUtil.findSameElementInCopy(e, file));
    }
    return ProgressManager.getInstance().runProcessWithProgressSynchronously(findDuplicatesComputable, JavaI18nBundle.message("progress.title.searching.for.duplicates.of.0", ((PsiLiteralExpression)literalExpression).getValue()), true, project);
  }
private PsiExpression @Nullable [] getDuplicateLiteralsUnderProgress(@NotNull PsiElement literalExpression)