public function buildLeaf($uniqueKey = null, $parentKey = null)
    {
        if (isset($this->crown[$uniqueKey])) {
            throw new InvalidArgumentException(sprintf(
                'The leaf with key "%s" is already exists.',
                $uniqueKey
            ));
        }
        if ($parentKey && ! isset($this->crown[$parentKey])) {
            throw new InvalidArgumentException(sprintf(
                'Unknown leaf "%s" specified as parent.',
                $parentKey
            ));
        }
        $leaf = clone $this->getLeafPrototype();
        $this->injectInCrown($leaf, $uniqueKey);

        if ($parentKey) {
            $parent = $this->crown[$parentKey];
            $parent->addChild($leaf);
        } else {
            $this->branch[$leaf->getUniqueKey()] = $leaf;
            $leaf->setDepth(0);
        }

        return $leaf;
    }