public static NetworkEndpoint forIpAndHostname(String ipAddress, String hostname) {
    return forIp(ipAddress).toBuilder()
        .setType(NetworkEndpoint.Type.IP_HOSTNAME)
        .setHostname(Hostname.newBuilder().setName(hostname))
        .build();
  }
@Test
  public void forIpAndHostname_returnsIpAndHostnameNetworkEndpoint() {
    assertThat(NetworkEndpointUtils.forIpAndHostname("1.2.3.4", "host.com"))
        .isEqualTo(
            NetworkEndpoint.newBuilder()
                .setType(NetworkEndpoint.Type.IP_HOSTNAME)
                .setIpAddress(
                    IpAddress.newBuilder()
                        .setAddressFamily(AddressFamily.IPV4)
                        .setAddress("1.2.3.4"))
                .setHostname(Hostname.newBuilder().setName("host.com"))
                .build());
  }