void () { DefaultMutableTreeNode root = new DefaultMutableTreeNode(); DefaultTreeModel model = new DefaultTreeModel(root); DefaultMutableTreeNode child1 = new DefaultMutableTreeNode("1"); model.insertNodeInto(child1, root, 0); model.insertNodeInto(new DefaultMutableTreeNode("2"), root, 1); assertSame(child1, TreeUtil.findNodeWithObject("1", model, root)); assertNull(TreeUtil.findNodeWithObject("3", model, root)); }