code: private static Type getActualType(Map<TypeVariable<?>, Type> map, Type type) {
      return TypeVisitor.of(type, b -> b
          .onClass(c -> c)
          .onTypeVariable(tv -> map.containsKey(tv) ? getActualType(map, map.get(tv)) : tv)
          .onParameterizedType(pt -> TypeVisitor.of(pt.getRawType(), bb -> bb
              .onClass(c -> createParameterizedType(c, pt.getOwnerType(),
                  Arrays.stream(pt.getActualTypeArguments()).map(t -> getActualType(map, t)).toArray(Type[]::new)))
              .result()))
          .onWildcardType(wt -> createWildcardType(
              Arrays.stream(wt.getUpperBounds()).map(t -> getActualType(map, t)).toArray(Type[]::new),
              Arrays.stream(wt.getLowerBounds()).map(t -> getActualType(map, t)).toArray(Type[]::new)))
          .onGenericArrayType(gat -> createGenericArrayType(getActualType(map, gat.getGenericComponentType())))
          .result(type));
    }
docs: Get actual type by the type map.
  
  @param map
  @param type
  @return The actual type. Return itself if it's already the most explicit type.