Java tutorial
//package com.java2s; import java.util.ArrayList; import java.util.List; public class Main { /** * Assign or make new list from source list. Use ArrayList for new list. * * @param src * @param dst * @return */ public static <T> List<T> instanceList(List<T> src, List<T> dst) { List<T> ret = null; if (src != null) { if (dst == null) { dst = new ArrayList<>(); } dst.clear(); dst.addAll(src); ret = dst; } return ret; } }