protected function getMethodResult($method, array $arguments)
    {
        if (!is_callable(['Elasticsearch\Client', $method])) {
            trigger_error(
                sprintf('Call to undefined or protected/private method %s::%s()', get_called_class(), $method),
                E_USER_ERROR
            );
        }

        if (empty($this->results[$method])) {
            throw new \Exception(
                sprintf("ElasticsearchMock results is empty for %s", $method)
            );
        }

        $this->calls[$method][] = $arguments;

        return array_shift($this->results[$method]);
    }