TreeModel mod = tree.getModel(); if (!mod.isLeaf(curr) && mod.getChildCount(curr) > 0) return mod.getChild(curr, 0);
if (!treeModel.isLeaf(curr) && treeModel.getChildCount(curr) > 0) return treeModel.getChild(curr, 0);
  Object getNextNode(Object curr)  {    TreeModel mod = tree.getModel();    if (!mod.isLeaf(curr) && mod.getChildCount(curr) > 0)      return mod.getChild(curr, 0);    Object node = curr;    Object sibling = null;        do      {        sibling = getNextSibling(node);        node = getParent(mod.getRoot(), node);      }    while (sibling == null && node != null);        return sibling;  }