### Question:
ArrayLong extends Array<Long> { @Override void arraycopy(int srcPos, Object dest, int destPos, long length) { if (indexFn.isCanonicalOrder()) { storage.arraycopy(srcPos, dest, destPos, length); } else { long[] ddest = (long[]) dest; int destIndex = destPos; Iterator<Integer> iter = indexFn.iterator(srcPos, length); while (iter.hasNext()) { ddest[destIndex++] = storage.get(iter.next()); } } } ArrayLong(DataType dtype, int[] shape);  ArrayLong(DataType dtype, int[] shape, Storage<Long> storage); private  ArrayLong(DataType dtype, IndexFn indexFn, Storage<Long> storageD); @Override Iterator<Long> fastIterator(); @Override Iterator<Long> iterator(); @Override Long get(int... index); @Override Long get(Index index);  }### Answer:
@Test public void testNonCanonicalOrder() { int[] shape = new int[] {1, 2, 3}; Storage<Long> store = new ArrayLong.StorageS(new long[] {1, 2, 3, 4, 5, 6}); Array<Long> array = new ArrayLong(DataType.LONG, shape, store); array = Arrays.flip(array, 1); long[] expected = new long[] {4, 5, 6, 1, 2, 3}; int count = 0; for (long val : array) { assertThat(val).isEqualTo(expected[count]); count++; } long[] result = new long[3]; array.arraycopy(1, result, 0, 3); assertThat(result).isEqualTo(new long[] {5, 6, 1}); }