@Test public void testCloneArrayWithBooleanAndSizeFour() { boolean[][] actual = new boolean[4][4]; boolean[][] clone = QuadraticArrays.cloneArray(actual); assertNotSame(clone, actual); assertEquals(clone.length, actual.length); assertEquals(clone[0].length, actual[0].length); }
static int[][] cloneArray(final int[][] array) { int[][] result = new int[array.length][]; for (int i = 0; i < array.length; i++) { result[i] = new int[array[i].length]; System.arraycopy(array[i], 0, result[i], 0, array[i].length); } return result; }
QuadraticArrays { static int[][] cloneArray(final int[][] array) { int[][] result = new int[array.length][]; for (int i = 0; i < array.length; i++) { result[i] = new int[array[i].length]; System.arraycopy(array[i], 0, result[i], 0, array[i].length); } return result; } }
QuadraticArrays { static int[][] cloneArray(final int[][] array) { int[][] result = new int[array.length][]; for (int i = 0; i < array.length; i++) { result[i] = new int[array[i].length]; System.arraycopy(array[i], 0, result[i], 0, array[i].length); } return result; } private  QuadraticArrays(); }
QuadraticArrays { static int[][] cloneArray(final int[][] array) { int[][] result = new int[array.length][]; for (int i = 0; i < array.length; i++) { result[i] = new int[array[i].length]; System.arraycopy(array[i], 0, result[i], 0, array[i].length); } return result; } private  QuadraticArrays(); static byte[][] parse(final String... rows); }
QuadraticArrays { static int[][] cloneArray(final int[][] array) { int[][] result = new int[array.length][]; for (int i = 0; i < array.length; i++) { result[i] = new int[array[i].length]; System.arraycopy(array[i], 0, result[i], 0, array[i].length); } return result; } private  QuadraticArrays(); static byte[][] parse(final String... rows);  }