public Set<Integer> lookUp(final String key) {
        final int len = key.length();
        Set<Integer> result = new HashSet<Integer>();

        // no point in checking if
        // the word is longer than the longest
        // word in the trie or if it is an empty word
        if (charBuffer.length < len || len == 0) {
            return result;
        }

//        Node node = root;
        key.getChars(0, len, charBuffer, 0);

        Queue<Pair<Node, Integer>> queue = new LinkedList<Pair<Node, Integer>>();
        int rootDepth = 0;
        Pair<Node, Integer> rootPair = new Pair<Node, Integer>(root, rootDepth);
        queue.add(rootPair);
        while (!queue.isEmpty()) {
            Pair<Node, Integer> pair = queue.remove();
            Node node = pair.getFirst();
            int depth = pair.getSecond();
            int nextDepth = depth + 1;
            if (depth == len) {
                result.addAll(node.getValues());
            } else {
                Character ch = charBuffer[depth];
                if (ch == WILDCARD) {
                    Node heavyChild = node.getHeavyChild();
                    if (heavyChild != null) {
                        Pair<Node, Integer> heavyPair = new Pair<Node, Integer>(heavyChild, nextDepth);
                        queue.add(heavyPair);
                    }
                }
                Node child = node.getChild(ch);
                if (child != null) {
                    Pair<Node, Integer> childPair = new Pair<Node, Integer>(child, nextDepth);
                    queue.add(childPair);
                }
            }
        }

        return result;

    }