public Tab getDynamicTab() {
        for (int i = 0; i < getChildCount(); i++) {
            UIComponent child = getChildren().get(i);
            if (child instanceof Tab) {
                return (Tab) child;
            }
        }

        throw new FacesException("p:tab is required as children in component with clientId: " + this.getClientId());
    }
Calculates the count value for the given index.

@param index

@return
primefaces/src/main/java/org/primefaces/component/api/UITabPanel.java