PAYLOADTYPE advance() {
            // Current node is depleted, find next
            while (unexploredNodes.size() > 0) {
                // Take the next node
                TraceNode node = unexploredNodes.remove(0);

                // Add its children to the list of nodes we1'll look at
                if (node.children != null) {
                    int i = 0; // used to fabricate depth-first traversal order
                    for (TraceNode child : node.children) {
                        unexploredNodes.add(i++, child);
                    }
                }

                Object payload = node.payload();
                if (payloadType.isInstance(payload)) {
                    return payloadType.cast(payload);
                }
            }
            return null;
        }
<p>Visits this <code>TraceNode</code> and all of its descendants in depth-first, prefix order.</p>

@param visitor The visitor to accept.
@return The <code>visitor</code> parameter.
vespajlib/src/main/java/com/yahoo/yolean/trace/TraceNode.java