private static <T> T enhance(Type typeToWrap, MethodEntry methodEntry) {
        try {
            net.sf.cglib.proxy.Enhancer e = new net.sf.cglib.proxy.Enhancer();
            Map<String, Class<?>> parameterizedTypeMap = null;
            if (typeToWrap instanceof ParameterizedType) {
                parameterizedTypeMap = prepareTypeMap(((ParameterizedType) typeToWrap));
                Class<?> type = (Class) ((ParameterizedType) typeToWrap).getRawType();
                if (type.isInterface()) {
                    e.setInterfaces(new Class[]{type, Parametrized.class});
                } else {
                    e.setSuperclass(type);
                    e.setInterfaces(new Class[]{Parametrized.class});
                }
            } else if (typeToWrap instanceof TypeVariable) {
                e.setSuperclass((methodEntry.getReturnType()));
            } else {
                e.setSuperclass((Class<?>) typeToWrap);
            }
            e.setCallback(new Interceptor(methodEntry, parameterizedTypeMap));
            return (T) e.create();
        } catch (NoSuchFieldException e) {
            throw new EnhanceException(e);
        } catch (IllegalAccessException e) {
            throw new EnhanceException(e);
        }
    }