code: private Page seek() {
      Page prev = next;
      next = null;
      while (resources.hasNext() && next == null) {
        Resource nextResource = resources.next();
        next = nextResource.adaptTo(Page.class);
  
        if (next == null) {
          // handle sling:Folder and sling:OrderedFolder as "virtual pages" to allow browsing pages below them
          String primaryType = nextResource.getValueMap().get(JcrConstants.JCR_PRIMARYTYPE, String.class);
          if (StringUtils.equals(primaryType, "sling:Folder") || StringUtils.equals(primaryType, "sling:OrderedFolder")) {
            next = new SlingFolderVirtualPage(nextResource);
          }
        }
  
        if (next != null && pageFilter != null && !pageFilter.includes(next)) {
          next = null;
        }
      }
      return prev;
    }
docs: Seeks the next available page
  @return the previous element