public static boolean isIpV6Endpoint(NetworkEndpoint networkEndpoint) {
    return hasIpAddress(networkEndpoint)
        && networkEndpoint.getIpAddress().getAddressFamily().equals(AddressFamily.IPV6);
  }
@Test
  public void isIpV6Endpoint_withIpV4Endpoint_returnsFalse() {
    NetworkEndpoint ipV4Endpoint =
        NetworkEndpoint.newBuilder()
            .setType(NetworkEndpoint.Type.IP)
            .setIpAddress(
                IpAddress.newBuilder().setAddress("1.2.3.4").setAddressFamily(AddressFamily.IPV4))
            .build();
    assertThat(NetworkEndpointUtils.isIpV6Endpoint(ipV4Endpoint)).isFalse();
  }