MockWebServer implements TestRule { public String getHostName() { maybeStart(); return inetSocketAddress.getHostName(); }  @Override Statement apply(final Statement base, Description description); int getPort(); String getHostName(); Proxy toProxyAddress(); void setServerSocketFactory(ServerSocketFactory serverSocketFactory); HttpUrl url(String path); void setBodyLimit(long maxBodyLength); void setProtocolNegotiationEnabled(boolean protocolNegotiationEnabled); void setProtocols(List<Protocol> protocols); void useHttps(SSLSocketFactory sslSocketFactory, boolean tunnelProxy); RecordedRequest takeRequest(); RecordedRequest takeRequest(long timeout, TimeUnit unit); int getRequestCount(); void enqueue(MockResponse response); void start(); void start(int port); void start(InetAddress inetAddress, int port); synchronized void shutdown(); void setDispatcher(Dispatcher dispatcher); @Override String toString();  }
@Test public void hostNameImplicitlyStarts() throws IOException { assertNotNull(server.getHostName()); }