public static IntArrayList permutation(int size, Random rnd) {
        IntArrayList result = iota(size);
        shuffle(result, rnd);
        return result;
    }
@Test
    public void testPermutation() {
        IntArrayList list = ArrayUtil.permutation(15, new Random());
        assertEquals(15, list.buffer.length);
        assertEquals(15, list.elementsCount);
        assertEquals(14 / 2.0 * (14 + 1), Arrays.stream(list.buffer).sum());
        assertTrue(ArrayUtil.isPermutation(list));
    }