private AggregationBuilder appendAggregation(CollectionExpression collectionExpression,
            EntityMetadata entityMetadata, AggregationBuilder aggregationBuilder)
    {
        ListIterable<Expression> functionlist = collectionExpression.children();
        for (Expression function : functionlist)
        {
            if (isAggregationExpression(function) && checkIfKeyExists(function.toParsedText()))
            {
                aggregationBuilder.subAggregation(getMetricsAggregation(function, entityMetadata));
            }
        }
        return aggregationBuilder;
    }
private AggregationBuilder appendAggregation ( CollectionExpression collectionExpression , EntityMetadata entityMetadata , AggregationBuilder aggregationBuilder ) { ListIterable < Expression > functionlist = collectionExpression . children ( ) ; for ( Expression function : functionlist ) { if ( isAggregationExpression ( function ) && checkIfKeyExists ( function . toParsedText ( ) ) ) { aggregationBuilder . subAggregation ( getMetricsAggregation ( function , entityMetadata ) ) ; } } return aggregationBuilder ; }
Append aggregation.

@param collectionExpression
the collection expression
@param entityMetadata
the entity metadata
@param nestedAggregation
@param aggregationBuilder
the aggregation builder
@return the filter aggregation builder