private static @Nullable PsiClassType findRequiredSuperQualifier(@Nullable PsiClass contextClass, PsiMethod methodToCall) {
      if (contextClass == null) return null;
      PsiClass superClass = methodToCall.getContainingClass();
      if (superClass == null || !superClass.isInterface()) return null;
      if (contextClass instanceof PsiAnonymousClass anonymousClass) {
        PsiClass baseClass = anonymousClass.getBaseClassType().resolve();
        return baseClass != null && baseClass.isInterface() ? anonymousClass.getBaseClassType() : null;
      }
      PsiClassType superType = PsiTypesUtil.getClassType(superClass);
      if (!contextClass.isInterface() &&
          ContainerUtil.exists(contextClass.getExtendsListTypes(), type -> TypeConversionUtil.isAssignable(superType, type))) {
        return null;
      }
      PsiClassType[] types = contextClass.isInterface() ? contextClass.getExtendsListTypes() : contextClass.getImplementsListTypes();
      return ContainerUtil.findLast(Arrays.asList(types), type -> TypeConversionUtil.isAssignable(superType, type));
    }
private static @Nullable PsiClassType findRequiredSuperQualifier(@Nullable PsiClass contextClass, PsiMethod methodToCall)