private function getMaximumAttempts($handlerClass)
    {
        $handler = $this->handlerFactory->create($handlerClass);
        if (!$handler instanceof RetryTaskHandlerInterface) {
            return 1;
        }

        return $handler->getMaximumAttempts();
    }