public boolean isPublicSuffix(String domain) {
        domain = Ascii.toLowerCase(DOTS_MATCHER.replaceFrom(domain, '.'));
        final String[] labels = domain.split("\\.");
        final int start = domain.charAt(0) == '.' ? 1 : 0;
        final int end = domain.charAt(domain.length() - 1) == '.' ? labels.length - 2 : labels.length - 1;
        TrieNode node = trie;
        for (int i = end; i >= start; i--) {
            if (node.children != null && node.children.containsKey(labels[i])) {
                node = node.children.get(labels[i]);
                assert node != null;
            } else {
                return false;
            }
            if (i == 1 && node.isWildcard) {
                if (node.children == null) {
                    return true;
                }
                if (!node.children.containsKey(labels[0])) {
                    return true;
                }
                final TrieNode child = node.children.get(labels[0]);
                assert child != null;
                return !child.isException;
            }
        }
        return node.isEnd;
    }
Returns whether a domain is a public suffix. Suffix matching is done as follow:
<ol>
    <li>Split the domain by dot '.' into labels. Leading and trailing dots are ignored.</li>

    <li>Iterate from the last label to first, at the same time traverse the trie from root. At index i,
    current node's children should contain a node with key = labels[i]. If not, then the domain does
    not match any rule and thus is not a public suffix.</li>

    <li>If the node has {@code isWildcard = true}, it can match any label at index i - 1. Since the
    wildcard is always the leftmost label, i should be 1, otherwise the domain does not match. For
    example, {@code *.ck} matches {@code a.ck}, but not {@code a.b.ck}.</li>

    <li>If we have a wildcard match, we still need to check for exception. If label i - 1 matches the
    next node and that node has {@code isException = true}, the wildcard is rejected.</li>
</ol>

@param domain A canonicalized domain. An internationalized domain name (IDN) should be Punycode
              encoded, for example, using {@link java.net.IDN#toASCII(String)}.
core/src/main/java/com/linecorp/armeria/internal/client/PublicSuffix.java