code: private void dumpNode(Node node, int level, int idx, java.io.PrintStream out) {
  
          // if node null, then return
          if (node == null) {
              return;
          }
  
          // print out required spaces
          printSpaces(level, out);
  
          if (idx == -2) {
              out.print("ROOT -> ");
          } else {
              out.print(idx + " -> ");
          }
  
          // print out the values
          out.print("S: ");
          if (node.getSpecificValue() != null) {
              out.print(node.getSpecificValue().toString());
          } else {
              out.print("(null)");
          }
          out.print(", W: ");
          if (node.getPrefixValue() != null) {
              out.println(node.getPrefixValue().toString());
          } else {
              out.println("(null)");
          }
  
          // loop through each child node
          for (int index = 0; index < 10; index++) {
              // dump out this node...
              dumpNode(node.getNode(index), level + 1, index, out);
          }
      }
docs: Recursively dumps a node at a certain index.