OkHttpConnectStrategy implements ConnectStrategy<OkHttpChannelBuilder> { @Override public OkHttpChannelBuilder connect(final HostnameAndPort hostnameAndPort) { return OkHttpChannelBuilder.forAddress(hostnameAndPort.getHostname(), hostnameAndPort.getPort()) .keepAliveTime(300L, TimeUnit.SECONDS) .keepAliveWithoutCalls(true); }  @Override OkHttpChannelBuilder connect(final HostnameAndPort hostnameAndPort);  }
@Test public void testConnect() throws InterruptedException { final OkHttpConnectStrategy connectStrategy = new OkHttpConnectStrategy(); final ManagedChannel channel = connectStrategy.connect(HostnameAndPort.of("localhost:9999")) .build(); assertNotNull(channel); channel.shutdown().awaitTermination(1, SECONDS); }