public static function getMapArrayFromFlatArray(array $options): array
    {
        $keyValueMap = [];
        $valueFromKeyNode = -1;
        foreach($options as $key => $value) {
            $isKeyNode = (($key % 2) == 0);
            if ($isKeyNode) {
                $valueFromKeyNode = $value;
            } else {
                if($valueFromKeyNode == -1) {
                    throw new \UnexpectedValueException('No optionValue before count value');
                }
                //we have a countNode
                $keyValueMap[$valueFromKeyNode] = $value;
            }
        }

        return $keyValueMap;
    }