int[] a1 = {9, 8, 7, 5, 1, 2, -1037, 3, 4, 0};
int[] ret = Arrays.copyOf(a1, a1.length);
assertNotSame(a1, ret);
assertTrue(Arrays.equals(a1, ret));
ret = Arrays.copyOf(a1, 2);
<BUG>assertTrue(Arrays.equals(new int[] {9, 8}, ret));
ret = Arrays.copyOf(a1, a1.length * 2);</BUG>
assertEquals(a1.length * 2, ret.length);
int i = 0;
for (; i < a1.length; i++) {

int[] a1 = {9, 8, 7, 5, 1, 2, -1037, 3, 4, 0};
int[] ret = Arrays.copyOf(a1, a1.length);
assertNotSame(a1, ret);
assertTrue(Arrays.equals(a1, ret));
ret = Arrays.copyOf(a1, 2);
assertTrue(Arrays.equals(new int[] {9, 8}, ret));
ret = Arrays.copyOf(a1, 0);
assertEquals(0, ret.length);
ret = Arrays.copyOf(a1, a1.length * 2);
assertEquals(a1.length * 2, ret.length);
int i = 0;
for (; i < a1.length; i++) {
