private static boolean validateTypesMethodsExistsInDelegateTargetType(@NotNull Collection<PsiType> types,
                                                                        @NotNull PsiType delegateTargetType,
                                                                        @NotNull ProblemSink sink) {
    boolean result = true;

    final Set<PsiType> typesToCheck = new HashSet<>(types);
    typesToCheck.remove(delegateTargetType);

    if (!typesToCheck.isEmpty()) {
      final PsiClassType.ClassResolveResult resolveResult = PsiUtil.resolveGenericsClassInType(delegateTargetType);
      final PsiClass psiDelegateTargetClass = resolveResult.getElement();
      if (null != psiDelegateTargetClass) {
        final Collection<MethodSignatureBackedByPsiMethod> delegateTargetSignatures =
          ContainerUtil.map(psiDelegateTargetClass.getVisibleSignatures(),
                            signature -> MethodSignatureBackedByPsiMethod.create(signature.getMethod(), resolveResult.getSubstitutor()));

        for (PsiType psiType : typesToCheck) {
          final PsiClass psiClass = PsiUtil.resolveClassInClassTypeOnly(psiType);
          if (null != psiClass) {
            final Collection<HierarchicalMethodSignature> methodSignatures = psiClass.getVisibleSignatures();

            for (HierarchicalMethodSignature methodSignature : methodSignatures) {
              final MethodSignatureBackedByPsiMethod matchingSignature =
                ContainerUtil.find(delegateTargetSignatures,
                                   signature -> MethodSignatureUtil.areSignaturesErasureEqual(signature, methodSignature));
              if (matchingSignature == null) {
                sink.addWarningMessage("inspection.message.delegate.unknown.type.method", methodSignature.getName())
                  .withLocalQuickFixes(() -> LocalQuickFix.from(new DeleteElementFix(methodSignature.getMethod())));
              }
            }
          }
        }
      }
    }

    return result;
  }
private static boolean validateTypesMethodsExistsInDelegateTargetType(@NotNull Collection<PsiType> types,
                                                                        @NotNull PsiType delegateTargetType,
                                                                        @NotNull ProblemSink sink)