code: private Type getRuntimeTypeIfMoreSpecific(Type type, Object value) {
      if (value != null
          && (type == Object.class || type instanceof TypeVariable<?> || type instanceof Class<?>)) {
        type = value.getClass();
      }
      return type;
    }
docs: Finds a compatible runtime type if it is more specific