public static int usagesCount(@NotNull PsiFile file, List<PsiMember> members, SearchScope scope) {
    Project project = file.getProject();
    ProgressIndicator progress = ObjectUtils.notNull(ProgressIndicatorProvider.getGlobalProgressIndicator(), /*todo remove*/new EmptyProgressIndicator());
    AtomicInteger totalUsageCount = new AtomicInteger();

    if (Registry.is("java.telescope.usages.single.threaded", true)) {
      ProgressManager.getInstance().runProcess(() -> {
        for (PsiMember member : members) {
          if (!countUsagesForMember(file, scope, member, project, totalUsageCount)) break;
        }
      }, progress);
    } else {
      JobLauncher.getInstance().invokeConcurrentlyUnderProgress(members, progress, member -> {
        return countUsagesForMember(file, scope, member, project, totalUsageCount);
      });
    }

    return totalUsageCount.get();
  }
public static int usagesCount(@NotNull PsiFile file, List<PsiMember> members, SearchScope scope)