public function addConstant(ClassConstantGenerator $constant)
    {
        $name = $constant->getName();
        if (isset($this->constants[$name]) === true) {
            throw new InvalidArgumentException('Constant name "' . $name . '" already added.');
        }

        $this->constants[$name] = $constant;
    }