public static String toUriAuthority(NetworkEndpoint networkEndpoint) {
    return toHostAndPort(networkEndpoint).toString();
  }
@Test
  public void toUriString_withHostnameEndpoint_returnsHostname() {
    NetworkEndpoint hostnameEndpoint =
        NetworkEndpoint.newBuilder()
            .setType(NetworkEndpoint.Type.HOSTNAME)
            .setHostname(Hostname.newBuilder().setName("localhost"))
            .build();
    assertThat(NetworkEndpointUtils.toUriAuthority(hostnameEndpoint)).isEqualTo("localhost");
  }