* 启动provider

dubbo-demo-api-provider

* 启动consumer

dubbo-demo-api-consumer

consumer设置generic

```java
    public static void main(String[] args) {
        ReferenceConfig<DemoService> reference = new ReferenceConfig<>();
        reference.setApplication(new ApplicationConfig("dubbo-demo-api-consumer"));
        reference.setRegistry(new RegistryConfig("zookeeper://127.0.0.1:2181"));
        reference.setInterface(DemoService.class);
        reference.setGeneric(true);
        
        Object obj = reference.get();
        for(Class c : obj.getClass().getInterfaces()) {
            System.err.println(c);
        }
        DemoService service = reference.get();
        String message = service.sayHello("dubbo");
        System.out.println(message);
    }
```

客户端会报错：

```
Exception in thread "main" java.lang.ClassCastException: org.apache.dubbo.common.bytecode.proxy0 cannot be cast to org.apache.dubbo.demo.DemoService
	at org.apache.dubbo.demo.consumer.Application.main(Application.java:42)
```
private ReferenceConfigCache(String name, KeyGenerator generator) {
        this.name = name;
        this.generator = generator;
    }
    /**
     * Get the cache use default name and {@link #DEFAULT_KEY_GENERATOR} to generate cache key.
     * Create cache if not existed yet.
     */
    public static ReferenceConfigCache getCache() {
        return getCache(DEFAULT_NAME);
    }
    /**
     * Get the cache use specified name and {@link KeyGenerator}.
     * Create cache if not existed yet.
     */
    public static ReferenceConfigCache getCache(String name) {
        return getCache(name, DEFAULT_KEY_GENERATOR);
    }
    /**
     * Get the cache use specified {@link KeyGenerator}.
     * Create cache if not existed yet.
     */
    public static ReferenceConfigCache getCache(String name, KeyGenerator keyGenerator) {
        return CACHE_HOLDER.computeIfAbsent(name, k -> new ReferenceConfigCache(k, keyGenerator));
    }
    @SuppressWarnings("unchecked")
    public <T> T get(ReferenceConfigBase<T> referenceConfig) {
        String key = generator.generateKey(referenceConfig);
        Class<?> type = referenceConfig.getInterfaceClass();
        proxies.computeIfAbsent(type, _t -> new ConcurrentHashMap());