@Test
public void testShuffle() {

    val n = 14;
    val orig = new double[n];
    for (int i = 0; i < n; i++) {
        orig[i] = i;
    }
    val copy = Arrays.copyOf(orig, n);
    ArrayUtil.shuffle(copy);
    int diffCount = 0;
    for (int i = 0; i < n; i++) {
        if (orig[i] != copy[i]) {
            diffCount++;
        }
    }
    // With n = 14 (see above), there are over 87T permutations.
    // So we can safely assume that the input and output are unequal.
    assertTrue(diffCount > 0);
    Arrays.sort(copy);
    assertArrayEquals(orig, copy, TOLERANCE);
}