public static function reindex($collection, $getIndex = 'getIdentifier') {
    if (!Code::isTraversable($collection)) {
      throw new \InvalidArgumentException('$collection muss Traversable sein. '.Code::varInfo($collection));
    }
    
    $getIndex = Code::castGetter($getIndex);
    $ret = array();
    foreach ($collection as $o) {
      $ret[$getIndex($o)] = $o;
    }

    return $ret;
  }