/**
  * Adds a sub-aggregation.
  *
  * @param AbstractAggregation $abstractAggregation
  */
 public function addAggregation(AbstractAggregation $abstractAggregation)
 {
     if (!$this->aggregations) {
         $this->aggregations = $this->createBuilderBag();
     }
     $this->aggregations->add($abstractAggregation);
 }
 /**
  * Tests if bag can get a builder.
  */
 public function testGet()
 {
     $bag = new BuilderBag();
     $bazBuilder = $this->getBuilder('baz');
     $builderName = $bag->add($bazBuilder);
     $this->assertNotEmpty($bag->get($builderName));
 }