protected function convertArrayToObject($objectData)
    {
        $objectName = $this->getCollectedObjectName();

        if (is_array($objectData)) {
            $object = new $objectName();
            $object->fromArray($objectData);
            $objectData = $object;
        }

        if (!($objectData instanceof $objectName)) {
            throw new InvalidArgumentException(sprintf('%s collection can handle %s objects only', $objectName, $objectName));
        }

        return $objectData;
    }