private static Class<?> toRawType(Type type) {
            if (type instanceof Class) {
                return (Class<?>) type;
            }
            if (type instanceof ParameterizedType) {
                return (Class<?>) ((ParameterizedType) type).getRawType();
            }
            if (type instanceof WildcardType) {
                final Type[] upperBounds = ((WildcardType) type).getUpperBounds();
                if (upperBounds.length > 0) {
                    return (Class<?>) upperBounds[0];
                }
            }
            if (type instanceof TypeVariable) {
                final Type[] bounds = ((TypeVariable<?>) type).getBounds();
                if (bounds.length > 0) {
                    return (Class<?>) bounds[0];
                }
            }

            throw new IllegalArgumentException("Unsupported or invalid parameter type: " + type);
        }
Sets an {@link AggregationStrategy} for the element.
core/src/main/java/com/linecorp/armeria/internal/server/annotation/AnnotatedValueResolver.java