Java tutorial
//package com.java2s; import java.util.ArrayList; import java.util.Collections; public class Main { public static <T> ArrayList<T> mergeLists(final T... array) { final ArrayList<T> retValue = new ArrayList<T>(); Collections.addAll(retValue, array); return retValue; } public static <T> int addAll(final T[] source, final ArrayList<T> destination) { int count = 0; for (final T sourceItem : source) { destination.add(sourceItem); ++count; } return count; } }