@GrpcGlobalServerInterceptor
    @Order(ORDER_FIRST)
    ServerInterceptor awaitableServerInterceptor() {
        return new ServerInterceptor() {

            @Override
            public <ReqT, RespT> Listener<ReqT> interceptCall(
                    final ServerCall<ReqT, RespT> call,
                    final Metadata headers,
                    final ServerCallHandler<ReqT, RespT> next) {

                if (serverCounter == null || serverCounter.getCount() == 0) {
                    return next.startCall(call, headers);
                } else {
                    final CountDownLatch thatCounter = serverCounter;
                    return new SimpleForwardingServerCallListener<ReqT>(next.startCall(call, headers)) {

                        @Override
                        public void onComplete() {
                            super.onComplete();
                            thatCounter.countDown();
                        }

                        @Override
                        public void onCancel() {
                            super.onCancel();
                            thatCounter.countDown();
                        }

                    };
                }
            }

        };
    }
A testing server interceptor, that allows awaiting the completion of the server call that is otherwise closed
asynchronously.

@return A testing server interceptor bean.
tests/src/test/java/net/devh/boot/grpc/test/config/AwaitableServerClientCallConfiguration.java