public function getByReference($reference, $type)
    {
        if (!isset($this->store[$type])) {
            return false;
        }

        $count = count($this->store[$type]);

        if ($reference >= $count) {
            throw new DeserializationException('Invalid ' . $type . ' reference: ' . $reference);
        }

        if (!$count) {
            return false;
        }

        return $this->store[$type][$reference];
    }