private @NotNull ModCommand processExistingExternalAnnotationsModCommand(@NotNull List<PsiModifierListOwner> listOwners,
                                                                           @NotNull List<String> annotationFQNs,
                                                                           @NotNull Processor<? super XmlTag> annotationTagProcessor) {
    if (listOwners.isEmpty()) return ModCommand.nop();
    List<XmlTag> origTags = StreamEx.of(listOwners)
      .mapToEntry(this::findExternalAnnotationsXmlFiles)
      .removeValues(f -> f == null || f.isEmpty())
      .flatMapKeyValue((owner, fileList) -> StreamEx.of(fileList)
        .cross(annotationFQNs)
        .flatMapKeyValue((file, annotationFQN) -> getTagsToProcess(file, owner, annotationFQN).stream()))
      .toList();
    if (origTags.isEmpty()) return ModCommand.nop();
    return ModCommand.psiUpdate(origTags.get(0), (tg, updater) -> {
      List<XmlTag> tags = ContainerUtil.map(origTags, updater::getWritable);
      Set<XmlFile> files = StreamEx.of(tags).map(t -> (XmlFile)t.getContainingFile()).toSet();
      for (XmlTag tag : tags) {
        if (tag.isValid()) {
          annotationTagProcessor.process(tag);
        }
      }
      if (!IntentionPreviewUtils.isIntentionPreviewActive()) {
        // Avoid too big preview changes
        for (XmlFile file : files) {
          sortItems(file);
        }
      }
    });
  }
private @NotNull ModCommand processExistingExternalAnnotationsModCommand(@NotNull List<PsiModifierListOwner> listOwners,
                                                                           @NotNull List<String> annotationFQNs,
                                                                           @NotNull Processor<? super XmlTag> annotationTagProcessor)