public static Class<?> getComponentClass(Field field) {
        if(field.getType().isArray()) {
            return field.getType().getComponentType();
        }
        Type type = field.getGenericType();
        if(type instanceof ParameterizedType) {
            ParameterizedType pType = (ParameterizedType) type;
            Type componentType = pType.getActualTypeArguments()[0];
            if(componentType instanceof Class<?>) {
                return (Class<?>) componentType;
            }else if(componentType instanceof ParameterizedType) {
                return (Class<?>) ((ParameterizedType) componentType).getRawType();
            }
        }
        return null;
    }