public static @NotNull Usage convertToSimilarUsage(PsiElement @NotNull [] primaryElements,
                                                     @NotNull UsageInfo usageInfo,
                                                     @NotNull ClusteringSearchSession session) {
    PsiElement usageElement = usageInfo.getElement();
    if (usageElement != null && primaryElements.length != 0) {
      Bag features = new Bag();
      UsageSimilarityFeaturesProvider.EP_NAME.forEachExtensionSafe(provider -> {
        features.addAll(provider.getFeatures(usageElement));
      });
      if (!features.isEmpty()) {
        final ReadWriteAccessDetector.Access readWriteAccess = ReadWriteUtil.getReadWriteAccess(primaryElements, usageElement);
        final SimilarUsage similarUsageAdapter;
        if (readWriteAccess != null) {
          similarUsageAdapter = new SimilarReadWriteUsageInfo2UsageAdapter(usageInfo, readWriteAccess, features, session);
        }
        else {
          similarUsageAdapter = new SimilarUsageInfo2UsageAdapter(usageInfo, features, session);
        }
        return session.clusterUsage(similarUsageAdapter);
      }
    }
    return convert(primaryElements, usageInfo);
  }
public static @NotNull Usage convertToSimilarUsage(PsiElement @NotNull [] primaryElements,
                                                     @NotNull UsageInfo usageInfo,
                                                     @NotNull ClusteringSearchSession session)