code: private static boolean isAssignable(final Type type, final Type toType,
                                          final Map<TypeVariable<?>, Type> typeVarAssigns) {
          if (toType == null || toType instanceof Class<?>) {
              return isAssignable(type, (Class<?>) toType);
          }
  
          if (toType instanceof ParameterizedType) {
              return isAssignable(type, (ParameterizedType) toType, typeVarAssigns);
          }
  
          if (toType instanceof GenericArrayType) {
              return isAssignable(type, (GenericArrayType) toType, typeVarAssigns);
          }
  
          if (toType instanceof WildcardType) {
              return isAssignable(type, (WildcardType) toType, typeVarAssigns);
          }
  
          if (toType instanceof TypeVariable<?>) {
              return isAssignable(type, (TypeVariable<?>) toType, typeVarAssigns);
          }
  
          throw new IllegalStateException("found an unhandled type: " + toType);
      }
docs: <p>Checks if the subject type may be implicitly cast to the target type
  following the Java generics rules.</p>
  
  @param type           the subject type to be assigned to the target type
  @param toType         the target type
  @param typeVarAssigns optional map of type variable assignments
  @return {@code true} if {@code type} is assignable to {@code toType}.