code: private void advance() {
          next = null;
  
          // While the underlying iterator has paths, check whether any are
          // accepted by the filter.
          while (iterator.hasNext() && next == null) {
              DependencyPath p = iterator.next();
              if (acceptor.accepts(p)) 
                  next = p;
          }        
      }
docs: Advances the {@link #next} reference to the next path to return or sets
  the value to {@code null} if no further paths exist.