@Test public void doubleArrayCopyOf1(){ double[] array = new double[] {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; ListNumber coll = new ArrayDouble(array); double[] array2 = CollectionNumbers.doubleArrayCopyOf(coll); assertThat(array2, equalTo(new double[] {0,1,2,3,4,5,6,7,8,9})); assertThat(array2, not(sameInstance(array))); }
public static double[] doubleArrayCopyOf(CollectionNumber coll) { double[] data = new double[coll.size()]; IteratorNumber iter = coll.iterator(); int index = 0; while (iter.hasNext()) { data[index] = iter.nextDouble(); index++; } return data; }
CollectionNumbers { public static double[] doubleArrayCopyOf(CollectionNumber coll) { double[] data = new double[coll.size()]; IteratorNumber iter = coll.iterator(); int index = 0; while (iter.hasNext()) { data[index] = iter.nextDouble(); index++; } return data; } }
CollectionNumbers { public static double[] doubleArrayCopyOf(CollectionNumber coll) { double[] data = new double[coll.size()]; IteratorNumber iter = coll.iterator(); int index = 0; while (iter.hasNext()) { data[index] = iter.nextDouble(); index++; } return data; } private  CollectionNumbers(); }
CollectionNumbers { public static double[] doubleArrayCopyOf(CollectionNumber coll) { double[] data = new double[coll.size()]; IteratorNumber iter = coll.iterator(); int index = 0; while (iter.hasNext()) { data[index] = iter.nextDouble(); index++; } return data; } private  CollectionNumbers(); static Object wrappedArray(CollectionNumber coll); static float[] wrappedFloatArray(CollectionNumber coll); static double[] wrappedDoubleArray(CollectionNumber coll); static byte[] wrappedByteArray(CollectionNumber coll); static short[] wrappedShortArray(CollectionNumber coll); static int[] wrappedIntArray(CollectionNumber coll); static long[] wrappedLongArray(CollectionNumber coll); static float[] floatArrayCopyOf(CollectionNumber coll); static double[] doubleArrayCopyOf(CollectionNumber coll); static byte[] byteArrayCopyOf(CollectionNumber coll); static short[] shortArrayCopyOf(CollectionNumber coll); static int[] intArrayCopyOf(CollectionNumber coll); static long[] longArrayCopyOf(CollectionNumber coll); static float[] floatArrayWrappedOrCopy(CollectionNumber coll); static double[] doubleArrayWrappedOrCopy(CollectionNumber coll); static byte[] byteArrayWrappedOrCopy(CollectionNumber coll); static short[] shortArrayWrappedOrCopy(CollectionNumber coll); static int[] intArrayWrappedOrCopy(CollectionNumber coll); static long[] longArrayWrappedOrCopy(CollectionNumber coll); }
CollectionNumbers { public static double[] doubleArrayCopyOf(CollectionNumber coll) { double[] data = new double[coll.size()]; IteratorNumber iter = coll.iterator(); int index = 0; while (iter.hasNext()) { data[index] = iter.nextDouble(); index++; } return data; } private  CollectionNumbers(); static Object wrappedArray(CollectionNumber coll); static float[] wrappedFloatArray(CollectionNumber coll); static double[] wrappedDoubleArray(CollectionNumber coll); static byte[] wrappedByteArray(CollectionNumber coll); static short[] wrappedShortArray(CollectionNumber coll); static int[] wrappedIntArray(CollectionNumber coll); static long[] wrappedLongArray(CollectionNumber coll); static float[] floatArrayCopyOf(CollectionNumber coll); static double[] doubleArrayCopyOf(CollectionNumber coll); static byte[] byteArrayCopyOf(CollectionNumber coll); static short[] shortArrayCopyOf(CollectionNumber coll); static int[] intArrayCopyOf(CollectionNumber coll); static long[] longArrayCopyOf(CollectionNumber coll); static float[] floatArrayWrappedOrCopy(CollectionNumber coll); static double[] doubleArrayWrappedOrCopy(CollectionNumber coll); static byte[] byteArrayWrappedOrCopy(CollectionNumber coll); static short[] shortArrayWrappedOrCopy(CollectionNumber coll); static int[] intArrayWrappedOrCopy(CollectionNumber coll); static long[] longArrayWrappedOrCopy(CollectionNumber coll);  }