protected function getStateAttributes($factory, $states, $modelClass)
    {
        return collect($states)
            ->flatMap(function ($state) use ($factory, $modelClass) {
                $stateClosure = call_user_func(
                    \Closure::bind(function () use ($modelClass, $state) {
                        if (!isset($this->states[$modelClass][$state])) {
                            throw new \InvalidArgumentException("Unable to locate [{$state}] state for [{$modelClass}].");
                        }

                        return $this->states[$modelClass][$state];
                    }, $factory, $factory)
                );

                return $stateClosure($this->generator);
            })
            ->all();
    }