DefaultMutableTreeNode (Group group) { DefaultMutableTreeNode node = new DefaultMutableTreeNode(group); for (Object child : group.getChildren()) { if (child instanceof Group) { DefaultMutableTreeNode childNode = createNode((Group)child); node.add(childNode); } else { LOG.assertTrue(child != null); node.add(new DefaultMutableTreeNode(child)); } } return node; }