@Test void ipv6_localhost() {
    String ipv6 = "::1";
    Endpoint endpoint = Endpoint.newBuilder().ip(ipv6).build();

    assertThat(endpoint.ipv4())
      .isNull();
    assertThat(endpoint.ipv4Bytes())
      .isNull();
    assertThat(endpoint.ipv6())
      .isEqualTo(ipv6);
    assertThat(endpoint.ipv6Bytes())
      .containsExactly(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1);
  }
This ensures we don't mistake IPv6 localhost for a mapped IPv4 0.0.0.1
zipkin/src/test/java/zipkin2/EndpointTest.java