@Override
      public boolean hasNext() {
        while (!current.hasNext() && nextOffset != null) {
          System.out.println("Wow.. even more results than " + nextOffset);
          Response<Page> nextPage = wikipedia.resumeSearch(query, nextOffset);
          current = nextPage.iterator();
          nextOffset = nextPage.nextOffset;
        }
        return current.hasNext();
      }
this will lazily continue searches, making new http calls as necessary.

@param wikipedia used to search
@param query see {@link Wikipedia#search(String)}.
example-wikipedia-with-springboot/src/main/java/example/wikipedia/WikipediaApplication.java