public static <T> Class<T> createProxyClass(MethodHandler methodHandler, TypeInfo typeInfo) { ProxyFactory proxyFactory = typeInfo.createProxyFactory(); if (methodHandler != null) { proxyFactory.setHandler(methodHandler); } @SuppressWarnings("unchecked") Class<T> clazz = proxyFactory.createClass(); return clazz; }