class ArrayUtil {

    public static void shuffle(double[] arr) {
        val rnd = ThreadLocalRandom.current();
        for (int i = arr.length - 1; i > 0; i--) {
            val index = rnd.nextInt(i + 1);
            val elemToSwap = arr[index];
            arr[index] = arr[i];
            arr[i] = elemToSwap;
        }
    }

}