android/guava/src/com/google/common/reflect/TypeResolver.java
static TypeResolver invariantly(Type contextType) {
    Type invariantContext = WildcardCapturer.INSTANCE.capture(contextType);
    return new TypeResolver().where(TypeMappingIntrospector.getTypeMappings(invariantContext));
  }
static TypeResolver invariantly(Type contextType) {
    Type invariantContext = WildcardCapturer.INSTANCE.capture(contextType);
    return new TypeResolver().where(TypeMappingIntrospector.getTypeMappings(invariantContext));
  }
Returns a resolver that resolves types "invariantly".

<p>For example, when resolving {@code List<T>} in the context of {@code ArrayList<?>}, {@code
<T>} cannot be invariantly resolved to {@code <?>} because otherwise the parameter type of
{@code List::set} will be {@code <?>} and it'll falsely say any object can be passed into
{@code ArrayList<?>::set}.

<p>Instead, {@code <?>} will be resolved to a capture in the form of a type variable {@code
<capture-of-? extends Object>}, effectively preventing {@code set} from accepting any type.