static TypeMirror substituteTypeVariables(
      TypeMirror input, Function<TypeVariable, TypeMirror> substitute, Types typeUtils) {
    SubstitutionVisitor substitutionVisitor = new SubstitutionVisitor(substitute, typeUtils);
    return substitutionVisitor.visit(input, null);
  }
Tests whether a given parameter can be given to a static method like {@code
ImmutableMap.copyOf} to produce a value that can be assigned to the given target type.

<p>For example, suppose we have this method in {@code ImmutableMap}:<br>
{@code static <K, V> ImmutableMap<K, V> copyOf(Map<? extends K, ? extends V>)}<br>
and we want to know if we can do this:

<pre>{@code
ImmutableMap<String, Integer> actualParameter = ...;
ImmutableMap<String, Number> target = ImmutableMap.copyOf(actualParameter);
}</pre>

We will infer {@code K=String}, {@code V=Number} based on the target type, and then rewrite the
formal parameter type from<br>
{@code Map<? extends K, ? extends V>} to<br>
{@code Map<? extends String, ? extends Number>}. Then we can check whether {@code
actualParameter} is assignable to that.

<p>The logic makes some simplifying assumptions, which are met for the {@code copyOf} and
{@code of} methods that we use this for. The method must be static, it must have exactly one
parameter, and it must have type parameters without bounds that are the same as the type
parameters of its return type. We can see that these assumptions are met for the {@code
ImmutableMap.copyOf} example above.
value/src/main/java/com/google/auto/value/processor/TypeVariables.java