Java tutorial
//package com.java2s; import java.util.ArrayList; public class Main { /** * create new ArrayList and copy from {@code src} to it. no effect to * {@code src}. */ static public ArrayList<Long> new_array_list_from(long[] src) { final ArrayList<Long> dest = new ArrayList<Long>(src.length); for (long x : src) { dest.add(x); } return dest; } }