@Override public boolean equals(Object o) {
    if (o == this) return true;
    if (!(o instanceof Endpoint)) return false;
    Endpoint that = (Endpoint) o;
    return Objects.equals(serviceName, that.serviceName)
      && Objects.equals(ipv4, that.ipv4)
      && Objects.equals(ipv6, that.ipv6)
      && port == that.port;
  }
Adapted from code in {@code com.google.common.net.InetAddresses.ipStringToBytes}. This version
separates detection from parsing and checks more carefully about embedded addresses.
zipkin/src/main/java/zipkin2/Endpoint.java