default int getColumnsCount(boolean visibleOnly) {
        final LongAdder columnsCount = new LongAdder();

        forEachColumn(true, true, true, column -> {
            if (!visibleOnly || column.isVisible()) {
                columnsCount.increment();
            }
            return true;
        });

        return columnsCount.intValue();
    }
Return each {@link Row} in a Column Group.
@param context  the {@link FacesContext}
@param cg the {@link ColumnGroup} to get
@param skipUnrendered If unrendered components should be skipped
@param callback The callback, which will be invoked for each row. If it returns false, the algorithm will be cancelled
@return false when the algorithm was cancelled
primefaces/src/main/java/org/primefaces/component/api/ColumnAware.java