Java tutorial
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.Collections; import java.util.List; public class Main { public static <T> List<T> clone(List<T> in) { List ret = new ArrayList(); if (in != null) { ret.addAll(in); } return ret; } public static <T> List<T> addAll(List<T> in, T... s) { Collections.addAll(in, s); return in; } public static List<Integer> addAll(List<Integer> in, int[] s) { for (int i : s) in.add(new Integer(i)); return in; } }