Iterator<PageContext> iterator;
if (pagination == null) {
if (query.getSiteType() == null || query.getSiteName() == null)
throw new IllegalArgumentException("Pagination is required when site type or site name is null.");
SiteKey siteKey = Util.from(new SiteId(query.getSiteType(), query.getSiteName()));
if (pageService instanceof PageServiceImpl) {
iterator = ((PageServiceImpl) pageService).loadPages(siteKey).iterator();
} else if (pageService instanceof PageServiceWrapper) {
iterator = ((PageServiceWrapper) pageService).loadPages(siteKey).iterator();
} else {