public static function mapKeys(array $array, Closure $closure = null): array
    {
        if (is_null($closure)) {
            $closure = '__::identity';
        }
        $resultArray = [];
        foreach ($array as $key => $value) {
            $newKey = call_user_func_array($closure, [$key, $value, $array]);
            // key must be a number or string
            if (!is_numeric($newKey) && !is_string($newKey)) {
                throw new Exception('closure must returns a number or string');
            }
            $resultArray[$newKey] = $value;
        }

        return $resultArray;
    }