CreateAopProxyInterceptor implements InstanceMethodsAroundInterceptor { @Override public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes, Object ret) throws Throwable { AdvisedSupport advisedSupport = (AdvisedSupport) allArguments[0]; Class targetClass = advisedSupport.getTargetClass(); if (targetClass != null && EnhancedInstance.class.isAssignableFrom(targetClass)) { return true; } return ret; }  @Override void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes,
        MethodInterceptResult result); @Override Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes,
        Object ret); @Override void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments,
        Class<?>[] argumentsTypes, Throwable t);  }
@Test public void testInterceptNormalObject() throws Throwable { doReturn(Object.class).when(advisedSupport).getTargetClass(); assertThat(false, is(interceptor.afterMethod(enhancedInstance, null, new Object[] {advisedSupport}, new Class[] {Object.class}, false))); }
@Test public void testInterceptEnhanceInstanceObject() throws Throwable { doReturn(MockClass.class).when(advisedSupport).getTargetClass(); assertThat(true, is(interceptor.afterMethod(enhancedInstance, null, new Object[] {advisedSupport}, new Class[] {Object.class}, false))); }