public static <T extends PsiMember & PsiNamedElement> void generateElements(@NotNull T psiElement,
                                                                              @NotNull PsiType delegateTargetType,
                                                                              @NotNull PsiAnnotation psiAnnotation,
                                                                              @NotNull List<? super PsiElement> target) {
    if (!(psiElement.getContainingClass() instanceof PsiExtensibleClass containingPsiClass)) {
      return;
    }

    final Collection<PsiType> includes = collectDelegateTypes(psiAnnotation, delegateTargetType);

    final Collection<Pair<PsiMethod, PsiSubstitutor>> includesMethods = new ArrayList<>();
    for (PsiType psiType : includes) {
      addMethodsOfType(psiType, includesMethods);
    }

    final Collection<PsiType> excludes = collectExcludeTypes(psiAnnotation);

    final Collection<Pair<PsiMethod, PsiSubstitutor>> excludeMethods = new ArrayList<>();
    for (PsiType psiType : excludes) {
      addMethodsOfType(psiType, excludeMethods);
    }

    // Add all already implemented methods to exclude list (includes methods from java.lang.Object too)
    collectAllOwnMethods(containingPsiClass, excludeMethods);

    final Collection<Pair<PsiMethod, PsiSubstitutor>> methodsToDelegate = findMethodsToDelegate(includesMethods, excludeMethods);
    for (Pair<PsiMethod, PsiSubstitutor> pair : methodsToDelegate) {
      target.add(generateDelegateMethod(containingPsiClass, psiElement, psiAnnotation, pair.getFirst(), pair.getSecond()));
    }
  }
public static <T extends PsiMember & PsiNamedElement> void generateElements(@NotNull T psiElement,
                                                                              @NotNull PsiType delegateTargetType,
                                                                              @NotNull PsiAnnotation psiAnnotation,
                                                                              @NotNull List<? super PsiElement> target)