class DimensionalObjectUtils {

    public static List<DimensionalItemObject> replaceOperandTotalsWithDataElements( List<DimensionalItemObject> items )
    {
        for ( int i = 0; i < items.size(); i++ )
        {
            DimensionalItemObject item = items.get( i );

            if ( DimensionItemType.DATA_ELEMENT_OPERAND.equals( item.getDimensionItemType() ) && ((DataElementOperand) item).isTotal() )
            {
                items.set( i, ((DataElementOperand) item).getDataElement() );
            }
        }

        return items;
    }

}