public boolean tryAdvance()

in templates/java/src/main/java/com/facebook/ads/sdk/APINodeList.java [214:240]


        public boolean tryAdvance(Consumer<? super T> action) {
          if (it.hasNext()) {
            action.accept(it.next());
            return true;
          } else {
            if (alreadySplit) {
              return false;
            } else {
              try {
                this.list = list.nextPage();
                if (this.list == null) {
                  return false;
                }
                this.it = list.getCurrentListIterator();
              } catch (APIException e) {
                throw new RuntimeException(e);
              }

              if (it.hasNext()) {
                action.accept(it.next());
                return true;
              } else {
                return false;
              }
            }
          }
        }