docs: public boolean isValidInet6Address(String inet6Address) {
          boolean containsCompressedZeroes = inet6Address.contains("::");
          if (containsCompressedZeroes && (inet6Address.indexOf("::") != inet6Address.lastIndexOf("::"))) {
              return false;
          }
          if ((inet6Address.startsWith(":") && !inet6Address.startsWith("::"))
                  || (inet6Address.endsWith(":") && !inet6Address.endsWith("::"))) {
              return false;
          }
          String[] octets = inet6Address.split(":");
          if (containsCompressedZeroes) {
              List<String> octetList = new ArrayList<>(Arrays.asList(octets));
              if (inet6Address.endsWith("::")) {
                  // String.split() drops ending empty segments
                  octetList.add("");
              } else if (inet6Address.startsWith("::") && !octetList.isEmpty()) {
                  octetList.remove(0);
              }
              octets = octetList.toArray(new String[0]);
          }
          if (octets.length > IPV6_MAX_HEX_GROUPS) {
              return false;
          }
          int validOctets = 0;
          int emptyOctets = 0; // consecutive empty chunks
          for (int index = 0; index < octets.length; index++) {
              String octet = octets[index];
              if (octet.length() == 0) {
                  emptyOctets++;
                  if (emptyOctets > 1) {
                      return false;
                  }
              } else {
                  emptyOctets = 0;
                  // Is last chunk an IPv4 address?
                  if (index == octets.length - 1 && octet.contains(".")) {
                      if (!isValidInet4Address(octet)) {
                          return false;
                      }
                      validOctets += 2;
                      continue;
                  }
                  if (octet.length() > IPV6_MAX_HEX_DIGITS_PER_GROUP) {
                      return false;
                  }
                  int octetInt = 0;
                  try {
                      octetInt = Integer.parseInt(octet, BASE_16);
                  } catch (NumberFormatException e) {
                      return false;
                  }
                  if (octetInt < 0 || octetInt > MAX_UNSIGNED_SHORT) {
                      return false;
                  }
              }
              validOctets++;
          }
          if (validOctets > IPV6_MAX_HEX_GROUPS || (validOctets < IPV6_MAX_HEX_GROUPS && !containsCompressedZeroes)) {
              return false;
          }
          return true;
      }