private void printNode(ITrieNode node, HashMap<Integer,Integer> frontier) {
        StringBuffer msg = new StringBuffer(String.valueOf(node.id));
        msg.append(" ").append(node.value).append(" weight ").append(node.weight);
        msg.append("=>").append(node.getWeight(frontier));
        System.out.println(msg.toString());
        if (this.children == null) {
            return;
        }
        for (ITrieNode t: node.children.values()) {
            printNode(t, frontier);
        }
    }