private List<PageElement> selectPageTemplates(Query query) {
        // Determine the list of page template ids
        @SuppressWarnings("unchecked")
        List<String> pageIds = (List<String>) query.properties().get(pageIdListName);
        if (pageIds == null) {
            String pageIdString = query.properties().getString(pageIdName,"").trim();
            if (!pageIdString.isEmpty())
                pageIds = List.of(pageIdString.split(" "));
        }

        // If none set, just return the default or null if none
        if (pageIds == null) {
            PageElement defaultPage=templateRegistry.getComponent("default");
            return (defaultPage == null ? List.of() : List.of(defaultPage));
        }

        // Resolve the id list to page templates
        List<PageElement> pages = new ArrayList<>(pageIds.size());
        for (String pageId : pageIds) {
            PageTemplate page = templateRegistry.getComponent(pageId);
            if (page == null)
                query.errors().add(ErrorMessage.createInvalidQueryParameter("Could not resolve requested page template '" +
                                                                            pageId + "'"));
            else
                pages.add(page);
        }

        return pages;
    }
Returns the list of page templates specified in the query, or the default if none, or the
empty list if no default, never null.
container-search/src/main/java/com/yahoo/search/pagetemplates/PageTemplateSearcher.java