### Question:
GrpcServer extends AbstractLifecycleComponent<StorageServerConfiguration> { @VisibleForTesting Server getGrpcServer() { return grpcServer; } GrpcServer(StorageContainerStore storageContainerStore,
                      StorageServerConfiguration conf,
                      Endpoint myEndpoint,
                      StatsLogger statsLogger); @VisibleForTesting  GrpcServer(StorageContainerStore storageContainerStore,
                      StorageServerConfiguration conf,
                      Endpoint myEndpoint,
                      String localServerName,
                      HandlerRegistry localHandlerRegistry,
                      StatsLogger statsLogger); static GrpcServer build(GrpcServerSpec spec);  }### Answer:
@Test public void testCreateLocalServer() { GrpcServer server = new GrpcServer( mock(StorageContainerStoreImpl.class), StorageServerConfiguration.of(compConf), null, name.getMethodName(), new MutableHandlerRegistry(), NullStatsLogger.INSTANCE); server.start(); assertEquals(-1, server.getGrpcServer().getPort()); server.close(); }
@Test public void testCreateBindServer() throws Exception { GrpcServer server = new GrpcServer( mock(StorageContainerStoreImpl.class), StorageServerConfiguration.of(compConf), StorageServer.createLocalEndpoint(0, false), null, null, NullStatsLogger.INSTANCE); server.start(); assertTrue(server.getGrpcServer().getPort() > 0); server.close(); }