private function populateProcessors(array &$handlerOptions, array $processors)
    {
        $processorArray = array();

        if (isset($handlerOptions['processors'])) {
            foreach ($handlerOptions['processors'] as $processorId) {
                if (isset($processors[$processorId])) {
                    $processorArray[] = $processors[$processorId];
                } else {
                    throw new \InvalidArgumentException(
                        sprintf(
                            'Cannot add processor "%s" to the handler. Processor not found.',
                            $processorId
                        )
                    );
                }
            }

            $handlerOptions['processors'] = $processorArray;
        }
    }