/**
  * Returns all sub aggregations.
  *
  * @return BuilderBag[]
  */
 public function getAggregations()
 {
     if ($this->aggregations) {
         return $this->aggregations->all();
     } else {
         return [];
     }
 }
 /**
  * Tests if bag can clear it's builders.
  */
 public function testClear()
 {
     $bag = new BuilderBag([$this->getBuilder('foo'), $this->getBuilder('baz')]);
     $bag->clear();
     $this->assertEmpty($bag->all());
 }