public static void transform(IntIndexedContainer arr, IntIndexedContainer map) {
        for (int i = 0; i < arr.size(); ++i)
            arr.set(i, map.get(arr.get(i)));
    }
@Test
    public void testTransform() {
        IntArrayList arr = from(7, 6, 2);
        ArrayUtil.transform(arr, ArrayUtil.constant(8, 4));
        assertEquals(IntArrayList.from(4, 4, 4), arr);

        IntArrayList brr = from(3, 0, 1);
        ArrayUtil.transform(brr, IntArrayList.from(6, 2, 1, 5));
        assertEquals(IntArrayList.from(5, 6, 2), brr);
    }