ServerCalls { public static <ReqT, RespT> ServerCallHandler<ReqT, RespT> asyncUnaryCall( final UnaryMethod<ReqT, RespT> method) { return asyncUnaryRequestCall(method); } private  ServerCalls(); static ServerCallHandler<ReqT, RespT> asyncUnaryCall(
      final UnaryMethod<ReqT, RespT> method); static ServerCallHandler<ReqT, RespT> asyncServerStreamingCall(
      final ServerStreamingMethod<ReqT, RespT> method); static ServerCallHandler<ReqT, RespT> asyncClientStreamingCall(
      final ClientStreamingMethod<ReqT, RespT> method); static ServerCallHandler<ReqT, RespT> asyncBidiStreamingCall(
      final BidiStreamingMethod<ReqT, RespT> method); static void asyncUnimplementedUnaryCall(MethodDescriptor<?, ?> methodDescriptor,
      StreamObserver<?> responseObserver); static StreamObserver<T> asyncUnimplementedStreamingCall(
      MethodDescriptor<?, ?> methodDescriptor, StreamObserver<?> responseObserver);  }
@Test public void disablingInboundAutoFlowControlForUnaryHasNoEffect() throws Exception { ServerCallHandler<Integer, Integer> callHandler = ServerCalls.asyncUnaryCall( new ServerCalls.UnaryMethod<Integer, Integer>() { @Override public void invoke(Integer req, StreamObserver<Integer> responseObserver) { ServerCallStreamObserver<Integer> serverCallObserver = (ServerCallStreamObserver<Integer>) responseObserver; serverCallObserver.disableAutoInboundFlowControl(); } }); ServerCall.Listener<Integer> callListener = callHandler.startCall(UNARY_METHOD, serverCall, new Metadata()); Mockito.verify(serverCall, times(1)).request(2); }