public function collection($collection, $index = '')
    {
        if (empty($index)) {
            if (empty($this->defaultIndex)) {
                throw new InvalidArgumentException('Unable to create a new data collection object: no index specified');
            }

            $index = $this->defaultIndex;
        }

        if (!array_key_exists($index, $this->collections)) {
            $this->collections[$index] = [];
        }

        if (!array_key_exists($collection, $this->collections[$index])) {
            $this->collections[$index][$collection] = new Collection($this, $collection, $index);
        }

        return $this->collections[$index][$collection];
    }