class TypeNameUtil {
    /**
     * 获取类名称（支持泛型）
     */
    public static TypeName getTypeName(Map<String, Type> typeGenericMap, Class<?> clz, Type type) {<FILL_FUNCTION_BODY>}

    public static Type getType(Map<String, Type> typeGenericMap, Class<?> clz, Type type) {
        if (type instanceof ParameterizedType) {
            ParameterizedType type2 = (ParameterizedType) type;

            if (type2.getActualTypeArguments().length > 0) {

                List<Type> petTypes = new ArrayList<>();
                for (Type e : type2.getActualTypeArguments()) {
                    if (e instanceof TypeVariable) {
                        e = typeGenericMap.get(e.getTypeName());
                    }

                    petTypes.add(e);
                }

                return new ParameterizedTypeImpl(clz, petTypes.toArray(new Type[]{}), type2.getOwnerType());
            } else {
                return type;
            }
        } else {
            if (type instanceof TypeVariable) {
                return typeGenericMap.get(type.getTypeName());
            } else {
                return type;
            }
        }
    }
}

        if (type instanceof ParameterizedType) {
            ParameterizedType type2 = (ParameterizedType) type;

            if (type2.getActualTypeArguments().length > 0) {
                //支持泛型
                ClassName petClassName = ClassName.get(clz);
                List<TypeName> petTypeVars = new ArrayList<>();
                for (Type e : type2.getActualTypeArguments()) {
                    if (e instanceof TypeVariable) {
                        Type e2 = typeGenericMap.get(e.getTypeName());
                        if(e2 != null){
                            e = e2;
                        }
                    }

                    petTypeVars.add(TypeName.get(e));
                }

                return ParameterizedTypeName.get(petClassName, petTypeVars.toArray(new TypeName[]{}));
            } else {
                return TypeName.get(type);
            }
        } else {
            if (type instanceof TypeVariable) {
                Type type2 = typeGenericMap.get(type.getTypeName());

                if(type2 != null){
                    type = type2;
                }
            }


            return TypeName.get(type);
        }
    
<no_super_class>