001 package org.kuali.maven.plugins.graph.dot; 002 003 import java.util.Enumeration; 004 005 import javax.swing.tree.DefaultMutableTreeNode; 006 007 import org.junit.Test; 008 009 public class TreeTest { 010 011 @Test 012 public void testTree() { 013 DefaultMutableTreeNode root = new DefaultMutableTreeNode(); 014 DefaultMutableTreeNode child = new DefaultMutableTreeNode(); 015 root.add(child); 016 017 Enumeration<?> e = root.children(); 018 while (e.hasMoreElements()) { 019 Object element = e.nextElement(); 020 DefaultMutableTreeNode dmtn = (DefaultMutableTreeNode) element; 021 Object userObject = dmtn.getUserObject(); 022 System.out.println(element.getClass()); 023 System.out.println(dmtn); 024 System.out.println(userObject); 025 } 026 } 027 }