public String longestPrefixOf(String string)
    {
        if (string == null || string.length() == 0)
        {
            throw new IllegalArgumentException();
        }
        if (root == null)
        {
            return null;
        }
        Node<V> node = getNextHere(root, string.charAt(0));
        if (node == null)
        {
            return null;
        }
        int count = 1;
        int length = string.length();
        for (int i = 1; i < length; ++i)
        {
            char c = string.charAt(i);
            if (node.letter == c)
            {
                node = node.equal;
            }
            else
            {
                while (node.letter != c)
                {
                    if (c < node.letter)
                    {
                        node = node.less;
                    }
                    else
                    {
                        node = node.greater;
                    }
                }
            }
            if (node == null)
            {
                return null;
            }
            ++count;
        }
        return string.substring(0, count);
    }