public List<Tab> getTabs() {
        if (tabs == null) {
            List<Tab> tabs = new ArrayList<>();

            headers.forEach(headerElt -> {
                String title = headerElt.findElement(By.tagName("a")).getText();
                int index = getIndexOfHeader(headerElt);
                WebElement content = contents.get(index);

                tabs.add(new Tab(title, index, headerElt, content));
            });

            this.tabs = tabs;
        }

        return tabs;
    }
Component wrapper for the PrimeFaces {@code p:tabView}.
primefaces-selenium/primefaces-selenium-components/src/main/java/org/primefaces/selenium/component/TabView.java