BidiStreamingCallable { public void call(final BidiStreamObserver<RequestT, ResponseT> bidiObserver) { call(bidiObserver, null); } protected  BidiStreamingCallable(); abstract ClientStream<RequestT> internalCall(
      ResponseObserver<ResponseT> responseObserver,
      ClientStreamReadyObserver<RequestT> onReady,
      ApiCallContext context); void call(final BidiStreamObserver<RequestT, ResponseT> bidiObserver); void call(
      final BidiStreamObserver<RequestT, ResponseT> bidiObserver, ApiCallContext context); BidiStream<RequestT, ResponseT> call(); BidiStream<RequestT, ResponseT> call(ApiCallContext context); ClientStream<RequestT> splitCall(ResponseObserver<ResponseT> responseObserver); ClientStream<RequestT> splitCall(
      ResponseObserver<ResponseT> responseObserver, ApiCallContext context); @Deprecated ApiStreamObserver<RequestT> bidiStreamingCall(
      ApiStreamObserver<ResponseT> responseObserver, ApiCallContext context); @Deprecated ApiStreamObserver<RequestT> bidiStreamingCall(
      ApiStreamObserver<ResponseT> responseObserver); BidiStreamingCallable<RequestT, ResponseT> withDefaultCallContext(
      final ApiCallContext defaultCallContext);  }
@Test public void bidiStreaming_BidiStreamObserver() throws InterruptedException { BidiStreamingStashCallable<Integer, Integer> callIntList = new BidiStreamingStashCallable<>(Arrays.asList(0, 1, 2)); BidiStreamingCallable<Integer, Integer> callable = FakeCallableFactory.createBidiStreamingCallable( callIntList, StreamingCallSettings.<Integer, Integer>newBuilder().build(), clientContext); AccumulatingBidiObserver observer = new AccumulatingBidiObserver(Arrays.asList(3, 4, 5)); callable.call(observer); assertThat(observer.getResponses()).containsExactly(0, 1, 2).inOrder(); assertThat(callIntList.getActualRequests()).containsExactly(3, 4, 5).inOrder(); }
@Test public void bidiStreaming_BidiStream() { BidiStreamingStashCallable<Integer, Integer> callIntList = new BidiStreamingStashCallable<>(Arrays.asList(0, 1, 2)); BidiStreamingCallable<Integer, Integer> callable = FakeCallableFactory.createBidiStreamingCallable( callIntList, StreamingCallSettings.<Integer, Integer>newBuilder().build(), clientContext); BidiStream<Integer, Integer> stream = callIntList.call(); stream.send(3); stream.send(4); stream.send(5); stream.closeSend(); assertThat(callIntList.getActualRequests()).containsExactly(3, 4, 5).inOrder(); assertThat(stream).containsExactly(0, 1, 2).inOrder(); }