protected function getIndexTypeForObject($object, Client $client = null)
    {
        if ($client === null) {
            $client = $this->client;
        }
        $className = TypeHandling::getTypeForValue($object);
        $indexAnnotation = $this->indexInformer->getClassAnnotation($className);
        if ($indexAnnotation === null) {
            return null;
        }
        $index = $client->findIndex($indexAnnotation->indexName);

        return new GenericType($index, $indexAnnotation->typeName);
    }