### Question:
ClientCalls { public static <ReqT, RespT> RespT blockingUnaryCall(ClientCall<ReqT, RespT> call, ReqT req) { try { return getUnchecked(futureUnaryCall(call, req)); } catch (RuntimeException e) { throw cancelThrow(call, e); } catch (Error e) { throw cancelThrow(call, e); } } private  ClientCalls(); static void asyncUnaryCall(
      ClientCall<ReqT, RespT> call, ReqT req, StreamObserver<RespT> responseObserver); static void asyncServerStreamingCall(
      ClientCall<ReqT, RespT> call, ReqT req, StreamObserver<RespT> responseObserver); static StreamObserver<ReqT> asyncClientStreamingCall(
      ClientCall<ReqT, RespT> call,
      StreamObserver<RespT> responseObserver); static StreamObserver<ReqT> asyncBidiStreamingCall(
      ClientCall<ReqT, RespT> call, StreamObserver<RespT> responseObserver); static RespT blockingUnaryCall(ClientCall<ReqT, RespT> call, ReqT req); static RespT blockingUnaryCall(
      Channel channel, MethodDescriptor<ReqT, RespT> method, CallOptions callOptions, ReqT req); static Iterator<RespT> blockingServerStreamingCall(
      ClientCall<ReqT, RespT> call, ReqT req); static Iterator<RespT> blockingServerStreamingCall(
      Channel channel, MethodDescriptor<ReqT, RespT> method, CallOptions callOptions, ReqT req); static ListenableFuture<RespT> futureUnaryCall(
      ClientCall<ReqT, RespT> call, ReqT req); static Object getArgumentFromRequest(Object request);  }### Answer:
@Test public void unaryBlockingCallSuccess() throws Exception { Integer req = 2; final String resp = "bar"; final Status status = Status.OK; final Metadata trailers = new Metadata(); NoopClientCall<Integer, String> call = new NoopClientCall<Integer, String>() { @Override public void start(ClientCall.Listener<String> listener, Metadata headers) { listener.onMessage(resp); listener.onClose(status, trailers); } }; String actualResponse = ClientCalls.blockingUnaryCall(call, req); assertEquals(resp, actualResponse); }
@Test public void unaryBlockingCallFailed() throws Exception { Integer req = 2; final Status status = Status.INTERNAL.withDescription("Unique status"); final Metadata trailers = new Metadata(); NoopClientCall<Integer, String> call = new NoopClientCall<Integer, String>() { @Override public void start(io.grpc.ClientCall.Listener<String> listener, Metadata headers) { listener.onClose(status, trailers); } }; try { ClientCalls.blockingUnaryCall(call, req); fail("Should fail"); } catch (StatusRuntimeException e) { assertSame(status, e.getStatus()); assertSame(trailers, e.getTrailers()); } }