private static <T extends PsiStatement> void checkDuplicateRefs(@NotNull Iterable<? extends T> statements,
                                                                  @NotNull Function<? super T, String> ref,
                                                                  @NotNull @PropertyKey(resourceBundle = JavaErrorBundle.BUNDLE) String key,
                                                                  @NotNull Consumer<? super HighlightInfo.Builder> errorSink) {
    Set<String> filter = new HashSet<>();
    for (T statement : statements) {
      String refText = ref.apply(statement);
      if (refText != null && !filter.add(refText)) {
        String message = JavaErrorBundle.message(key, refText);
        HighlightInfo.Builder info =
          HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(statement).descriptionAndTooltip(message);
        IntentionAction action1 = QuickFixFactory.getInstance().createDeleteFix(statement);
        info.registerFix(action1, null, null, null, null);
        var action = MergeModuleStatementsFix.createFix(statement);
        if (action != null) {
          info.registerFix(action, null, null, null, null);
        }
        errorSink.accept(info);
      }
    }
  }
private static <T extends PsiStatement> void checkDuplicateRefs(@NotNull Iterable<? extends T> statements,
                                                                  @NotNull Function<? super T, String> ref,
                                                                  @NotNull @PropertyKey(resourceBundle = JavaErrorBundle.BUNDLE) String key,
                                                                  @NotNull Consumer<? super HighlightInfo.Builder> errorSink)