Object next = null; TreePath current = null;  if (node != null) next = getNextNode(node);  if (next != null)
if (currentVisiblePath != null)
  Object getNextVisibleNode(Object node)  {    Object next = null;    TreePath current = null;    if (node != null)      next = getNextNode(node);    if (next != null)      {        current = new TreePath(getPathToRoot(next, 0));        if (tree.isVisible(current))          return next;        while (next != null && !tree.isVisible(current))          {            next = getNextNode(next);            if (next != null)              current = new TreePath(getPathToRoot(next, 0));          }      }    return next;  }