code: private static void displayCategories(List<CategoryNode> categories, String prefix) {
      for (CategoryNode category : categories) {
        System.out.printf("%s%s [%s]%n", prefix, category.name, category.id);
        displayCategories(category.children, String.format("%s%s > ", prefix, category.name));
      }
    }
docs: Recursively prints out each category node and its children.
  
  @param categories the categories to print.
  @param prefix the string to print at the beginning of each line of output.