docs: static boolean canAssignStaticMethodResult(
        ExecutableElement method,
        TypeMirror actualParameterType,
        TypeMirror targetType,
        Types typeUtils) {
      if (!targetType.getKind().equals(TypeKind.DECLARED)
          || !method.getModifiers().contains(Modifier.STATIC)
          || method.getParameters().size() != 1) {
        return false;
      }
      List<? extends TypeParameterElement> typeParameters = method.getTypeParameters();
      List<? extends TypeMirror> targetTypeArguments =
          MoreTypes.asDeclared(targetType).getTypeArguments();
      if (typeParameters.size() != targetTypeArguments.size()) {
        return false;
      }
      Map<Equivalence.Wrapper<TypeVariable>, TypeMirror> typeVariables = new LinkedHashMap<>();
      for (int i = 0; i < typeParameters.size(); i++) {
        TypeVariable v = MoreTypes.asTypeVariable(typeParameters.get(i).asType());
        typeVariables.put(MoreTypes.equivalence().wrap(v), targetTypeArguments.get(i));
      }
      TypeMirror formalParameterType = method.getParameters().get(0).asType();
      SubstitutionVisitor substitutionVisitor = new SubstitutionVisitor(typeVariables, typeUtils);
      TypeMirror substitutedParameterType = substitutionVisitor.visit(formalParameterType, null);
      if (substitutedParameterType.getKind().equals(TypeKind.WILDCARD)) {
        // If the target type is Optional<? extends Foo> then <T> T Optional.of(T) will give us
        // ? extends Foo here, and typeUtils.isAssignable will return false. But we can in fact
        // give a Foo as an argument, so we just replace ? extends Foo with Foo.
        WildcardType wildcard = MoreTypes.asWildcard(substitutedParameterType);
        if (wildcard.getExtendsBound() != null) {
          substitutedParameterType = wildcard.getExtendsBound();
        }
      }
      return typeUtils.isAssignable(actualParameterType, substitutedParameterType);
    }