public function shuffle(array $array, $preserveKeys = true): array
    {
        if ($array === []) {
            return $array;
        }
        if ($preserveKeys) {
            $keys = array_keys($array);
            shuffle($keys);
            $shuffledArray = [];
            foreach ($keys as $key) {
                $shuffledArray[$key] = $array[$key];
            }
            $array = $shuffledArray;
        } else {
            shuffle($array);
        }
        return $array;
    }