Returns an Iterable over the descendents of this node (not including this node).  Descendents
are traversed in pre-order.

@return a pre-ordered iterator over the descendents of this node
970674
public Iterable<SimpleXmlNode> getDescendents() {
    return new Iterable<SimpleXmlNode>() {
      @Override
      public Iterator<SimpleXmlNode> iterator() {
        return new DescendentsIterator(SimpleXmlNode.this);
      }
    };
  }
682642
public Iterator<Node> iterator() {

        return new Iterator<Node>() {
            private int currentIndex = 0;
            
            public boolean hasNext() {
                return currentIndex < nodeList.getLength();
            }
            
            public Node next() {
                Node next = nodeList.item(currentIndex);
                currentIndex++;
                if (next == null) {
                    throw new NoSuchElementException("No element found for index: " + currentIndex);
                }
                return next;
            }
            
            public void remove() {
                throw new UnsupportedOperationException("IterableNodeList does not support remove");
            }
        };
    }
769842
@Override
    public Iterator<Tree> iterator() {
        return new Iterator<Tree>() {
            @Override
            public boolean hasNext() {
                return next != null;
            }

            @Override
            public Tree next() {
                Tree t = next.leaf;
                next = next.parent;
                return t;
            }

            @Override
            public void remove() {
                throw new UnsupportedOperationException();
            }

            private TreePath next = TreePath.this;
        };
    }
850094
public static <E> Iterator<E> get() {
		@SuppressWarnings("unchecked")
		Iterator<E> iter = (Iterator<E>) INSTANCE;
		return iter;
	}
1071029
public Node previousSibling() {
        if (parentNode == null)
            return null; // root

        if (siblingIndex > 0)
            return parentNode.ensureChildNodes().get(siblingIndex-1);
        else
            return null;
    }
624817
public List<Entity> getAllChildrenRecursive() {
        List<Entity> result = newArrayList();
        if (isRoot()) {
            allChildrenRecursive(this, result);
        }
        return result;
    }
827023
public QuadTreeIterator getIterator() {
		QuadTreeImpl.QuadTreeIteratorImpl iterator = m_impl.getIterator();
		return new QuadTreeIterator(iterator, false);
	}
688658
public static <T> Predicate<T> iterablePresent() {
        return t -> t instanceof Iterable ? ((Iterable) t).iterator()
                                                          .hasNext()
                : false;
    }
1109101
public Iterator<E> iterator() {
        final Iterator<? extends E> itr = core.iterator();
        return new Iterator<E>() {
            private E last;
            public boolean hasNext() {
                return itr.hasNext();
            }

            public E next() {
                return last=itr.next();
            }

            public void remove() {
                CopyOnWriteList.this.remove(last);
            }
        };
    }
1111844
protected int getNextNode()
  {
    m_lastFetched = (DTM.NULL == m_lastFetched)
                     ? m_traverser.first(m_context)
                     : m_traverser.next(m_context, m_lastFetched);
    return m_lastFetched;
  }
916660
public HelpTopicNode getPreviousSibling() {
        int i = getIndex() - 1;
        return i < 0 ? null : parent.children.get(i);
    }
950987
public SortedSet<Entry> getChildEntries() throws IOException {
        if (children == null) {
            if (isFile() || rootNodeDId == -1) {
                children = NO_CHILDREN;
            }
            else {
                // Start at root node in R/B tree, and read to the left and right,
                // re-build tree, according to the docs
                children = Collections.unmodifiableSortedSet(document.getEntries(rootNodeDId, this));
            }
        }

        return children;
    }
240118
public Iterator<Symbol> iterator() {
        return scope.getSymbols(t -> !unwanted(t), NON_RECURSIVE).iterator();
    }
53831
@Override
    public Collection<N> getNodes() {
        List<N> nodes = new ArrayList<>();
        Iterables.addAll(nodes, GraphTraversal.breadthFirstOrder(this, Collections.singleton(root)));
        return nodes;
    }
411376
@Nonnull
    public Iterator<S> bfsIterator() {
        Set<S> visited = new HashSet<>();
        final Deque<S> bfsQueue = new ArrayDeque<>();
        bfsQueue.add(root);
        visited.add(root);

        return new AbstractIterator<S>() {

            @Override
            protected S computeNext() {
                S next = bfsQueue.poll();
                if (next == null) {
                    return endOfData();
                }
                for (int i = 0; i < alphabetSize; i++) {
                    S child = next.getSuccessor(i);
                    if (child != null && visited.add(child)) {
                        bfsQueue.offer(child);
                    }
                }
                return next;
            }
        };
    }
1186971
public Flowable<Tree<T>> parents() {
    return Flowable.generate(() -> Wrapper.of(this), (n, e) -> {
      Tree<T> parent = n.get().getParent();
      if (parent != null) {
        e.onNext(parent);
        n.set(parent);
      } else {
        e.onComplete();
      }
    });
  }
1049038
@NonNull
  @Override
  public Iterator<Node> iterator() {
    int i = nextIndex.get();
    if (i >= nodes.length) {
      return Collections.<Node>emptyList().iterator();
    } else {
      return Iterators.forArray(Arrays.copyOfRange(nodes, i, nodes.length, Node[].class));
    }
  }