### Question:
HelloWorldServer { private void start() throws IOException { int port = 50051; server = ServerBuilder.forPort(port) .addService(new GreeterImpl()) .build() .start(); logger.info("Server started, listening on " + port); Runtime.getRuntime().addShutdownHook(new Thread() { @Override public void run() { System.err.println("*** shutting down gRPC server since JVM is shutting down"); HelloWorldServer.this.stop(); System.err.println("*** server shut down"); } }); }  static void main(String[] args);  }### Answer:
@Test public void greeterImpl_replyMessage() throws Exception { String serverName = InProcessServerBuilder.generateName(); grpcCleanup.register(InProcessServerBuilder .forName(serverName).directExecutor().addService(new GreeterImpl()).build().start()); GreeterGrpc.GreeterBlockingStub blockingStub = GreeterGrpc.newBlockingStub( grpcCleanup.register(InProcessChannelBuilder.forName(serverName).directExecutor().build())); HelloReply reply = blockingStub.sayHello(HelloRequest.newBuilder().setName( "test name").build()); assertEquals("Hello test name", reply.getMessage()); }