### Question:
HelloWorldClient { public void greet(String name) { logger.info("Will try to greet " + name + " ..."); HelloRequest request = HelloRequest.newBuilder().setName(name).build(); HelloReply response; try { response = blockingStub.sayHello(request); } catch (StatusRuntimeException e) { logger.log(Level.WARNING, "RPC failed: {0}", e.getStatus()); return; } logger.info("Greeting: " + response.getMessage()); } HelloWorldClient(String host, int port);   HelloWorldClient(ManagedChannel channel); void shutdown(); void greet(String name); static void main(String[] args);  }### Answer:
@Test public void greet_messageDeliveredToServer() { ArgumentCaptor<HelloRequest> requestCaptor = ArgumentCaptor.forClass(HelloRequest.class); client.greet("test name"); verify(serviceImpl) .sayHello(requestCaptor.capture(), Matchers.<StreamObserver<HelloReply>>any()); assertEquals("test name", requestCaptor.getValue().getName()); }