*
* @param clazz interfaces (ONLY, no class or primitives) to be casted to
*/
public static <T> T _proxyClass(Object target, Class<T> clazz) {
if (!clazz.isInterface()) {
throw new IllegalArgumentException("Class " + clazz + " is not an interface");
}
return target == null ? null : (T) Proxy.newProxyInstance(clazz.getClassLoader(), new Class[]{clazz},
_proxyClassHandler(target));
}