private static @Nullable PsiElement findTarget(@Nullable PsiClass psiClass,
                                                     @NotNull PsiMethod method,
                                                     @Nullable PsiDocTag docTag,
                                                     @Nullable String explicitSuper) {
        if (psiClass == null || explicitSuper != null && !explicitSuper.equals(psiClass.getName())) {
          return null;
        }

        final var matchedMethod = psiClass.findMethodBySignature(method, false);
        if (matchedMethod == null) return null;

        PsiDocComment docComment = matchedMethod.getDocComment();
        if (docComment == null) return null;

        // inheritDoc is not in a tag -> the target is the PsiDocComment
        if (docTag == null) return docComment;

        // Searching for a matching tag
        final PsiDocTagValue tagValue = docTag.getValueElement();
        for (PsiDocTag tag : docComment.findTagsByName(docTag.getName())) {
          final var matchedTagValueElement = tag.getValueElement();
          if (tagValue != null && matchedTagValueElement == null) continue;
          if (tagValue == null || tagValue.getText().equals(matchedTagValueElement.getText())) {
            return tag;
          }
        }

        return null;
      }
private static @Nullable PsiElement findTarget(@Nullable PsiClass psiClass,
                                                     @NotNull PsiMethod method,
                                                     @Nullable PsiDocTag docTag,
                                                     @Nullable String explicitSuper)