/**
  * @param CodepointAssigned $entity
  * @return Aggregator
  */
 protected function getAggregatorFor(CodepointAssigned $entity)
 {
     $key = $this->keyGenerator->generateFor($entity);
     if (!array_key_exists($key, $this->aggregators)) {
         $this->aggregators[$key] = new Aggregator();
     }
     return $this->aggregators[$key];
 }
 public function it_exposes_all_ranges_built_by_aggregators(KeyGenerator $keyGenerator, CodepointAssigned $item)
 {
     $key = 'key';
     $cp = Codepoint::fromInt(1);
     $item->getCodepoint()->willReturn($cp);
     $keyGenerator->generateFor($item)->willReturn($key);
     $this->beConstructedWith($keyGenerator);
     $this->add($item);
     $this->getAllRanges()->shouldBeLike([$key => Range\Collection::fromArray([Range::between($cp, $cp)])]);
 }