### Question:
MyProxyUtil { public static BaseService getBaseServiceWithCgLib(BaseService baseService) { Enhancer enhancer = new Enhancer(); enhancer.setSuperclass(baseService.getClass()); enhancer.setCallback(new MethodInterceptor() { @Override public Object intercept(Object o, Method method, Object[] objects, MethodProxy methodProxy) throws Throwable { System.out.println("cglib代理"); return methodProxy.invokeSuper(o, objects); } }); return (BaseService) enhancer.create(); }  static void main(String[] args); static BaseService getBaseServiceWithJdk(BaseService baseService); static BaseService getBaseServiceWithCgLib(BaseService baseService);  }### Answer:
@Test public void getBaseServiceWithCgLib() { BaseService bs = new BaseServiceImpl(); BaseService proxy = MyProxyUtil.getBaseServiceWithCgLib(bs); proxy.doSome(); }