public static boolean isIpV6Endpoint(NetworkEndpoint networkEndpoint) {
    return hasIpAddress(networkEndpoint)
        && networkEndpoint.getIpAddress().getAddressFamily().equals(AddressFamily.IPV6);
  }
@Test
  public void isIpV6Endpoint_withHostnameAndPortEndpoint_returnsFalse() {
    NetworkEndpoint hostnameAndPortEndpoint =
        NetworkEndpoint.newBuilder()
            .setType(NetworkEndpoint.Type.HOSTNAME_PORT)
            .setPort(Port.newBuilder().setPortNumber(8888))
            .setHostname(Hostname.newBuilder().setName("localhost"))
            .build();
    assertThat(NetworkEndpointUtils.isIpV6Endpoint(hostnameAndPortEndpoint)).isFalse();
  }