private static void addTypeToList(Type type, List<Type> typeList) {
        if (type instanceof ParameterizedType) {
            ParameterizedType parameterizedType = (ParameterizedType) type;
            addTypeToList(parameterizedType.getRawType(), typeList);
            for (Type actualTypeArgument : parameterizedType.getActualTypeArguments()) {
                addTypeToList(actualTypeArgument, typeList);
            }
        } else {
            typeList.add(type);
        }
    }
private static void addTypeToList ( Type type , List < Type > typeList ) { if ( type instanceof ParameterizedType ) { ParameterizedType parameterizedType = ( ParameterizedType ) type ; addTypeToList ( parameterizedType . getRawType ( ) , typeList ) ; for ( Type actualTypeArgument : parameterizedType . getActualTypeArguments ( ) ) { addTypeToList ( actualTypeArgument , typeList ) ; } } else { typeList . add ( type ) ; } }
TODO

@param type
@param typeList