public function method($callable, bool $testMethod = null): string
    {
        if (is_string($callable) && false !== strstr($callable, '::')) {
            $callable = explode('::', $callable);
        }

        if (!is_array($callable) || empty($callable[0]) || empty($callable[1])) {
            throw new InvalidArgumentException(sprintf('Provided callable is not a valid callable'));
        }

        try {
            $reflection = new ReflectionMethod($callable[0], $callable[1]);

            return $reflection->name;
        } catch (ReflectionException $e) {
            if ((null === $testMethod && $this->allowNonExistingMethods) || false === $testMethod) {
                return $callable[1];
            }

            throw $e;
        }
    }