ClusterConnectInterceptor implements InstanceMethodsAroundInterceptor { @Override public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes, Object ret) throws Throwable { if (ret instanceof EnhancedInstance) { String keyspace = allArguments.length > 0 ? (String) allArguments[0] : null; ConnectionInfo connectionInfo = (ConnectionInfo) objInst.getSkyWalkingDynamicField(); connectionInfo.setKeyspace(keyspace); ((EnhancedInstance) ret).setSkyWalkingDynamicField(connectionInfo); } 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 afterMethod() throws Throwable { EnhancedInstance ret = (EnhancedInstance) interceptor.afterMethod(enhancedInstance, method, new Object[] {"test"}, null, enhancedInstance); ConnectionInfo connectionInfo = (ConnectionInfo) ret.getSkyWalkingDynamicField(); Assert.assertThat(connectionInfo.getKeyspace(), Is.is("test")); }