private SofaResponseCallback buildCallback(final Object[] ret, final CountDownLatch[] latch) {
        return new SofaResponseCallback() {
            @Override
            public void onAppResponse(Object appResponse, String methodName, RequestBase request) {
                LOGGER.info("A get result: {}", appResponse);
                ret[0] = appResponse;
                latch[0].countDown();
            }

            @Override
            public void onAppException(Throwable throwable, String methodName, RequestBase request) {
                LOGGER.info("A get app exception: ", throwable);
                ret[0] = throwable;
                latch[0].countDown();
            }

            @Override
            public void onSofaException(SofaRpcException sofaException, String methodName,
                                        RequestBase request) {
                LOGGER.info("A get sofa exception: ", sofaException);
                ret[0] = sofaException;
                latch[0].countDown();
            }
        };
    }
@author <a href="mailto:zhanggeng.zg@antfin.com">GengZhang</a>
test/test-integration/src/test/java/com/alipay/sofa/rpc/test/async/AsyncChainTest.java