Node<K> advance() {
      Node<K> e;
      if ((e = next) != null) {
        e = e.next;
      }
      for (;;) {
        Node<K>[] t;
        int i, n; // must use locals in checks
        if (e != null) {
          return next = e;
        }
        if (baseIndex >= baseLimit || (t = tab) == null || (n = t.length) <= (i = index) || i < 0) {
          return next = null;
        }
        if ((e = tabAt(t, i)) != null && e.hash < 0) {
          if (e instanceof ForwardingNode) {
            tab = ((ForwardingNode<K>) e).nextTable;
            e = null;
            pushState(t, i, n);
            continue;
          } else if (e instanceof TreeBin) {
            e = ((TreeBin<K>) e).first;
          } else {
            e = null;
          }
        }
        if (stack != null) {
          recoverState(n);
        } else if ((index = i + baseSize) >= n) {
          index = ++baseIndex; // visit upper slots if present
        }
      }
    }
Advances if possible, returning next valid node, or null if none.
geode-core/src/main/java/org/apache/geode/internal/concurrent/CompactConcurrentHashSet2.java